app-service.js 510 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087
  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 global = uni.requireGlobal();
  15. ArrayBuffer = global.ArrayBuffer;
  16. Int8Array = global.Int8Array;
  17. Uint8Array = global.Uint8Array;
  18. Uint8ClampedArray = global.Uint8ClampedArray;
  19. Int16Array = global.Int16Array;
  20. Uint16Array = global.Uint16Array;
  21. Int32Array = global.Int32Array;
  22. Uint32Array = global.Uint32Array;
  23. Float32Array = global.Float32Array;
  24. Float64Array = global.Float64Array;
  25. BigInt64Array = global.BigInt64Array;
  26. BigUint64Array = global.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. function formatAppLog(type, filename, ...args) {
  35. if (uni.__log__) {
  36. uni.__log__(type, filename, ...args);
  37. } else {
  38. console[type].apply(console, [...args, filename]);
  39. }
  40. }
  41. const BASE_URL = "http://192.168.1.118:8080";
  42. const CLIENT_ID = "fe63fea7be31b0200b496d08bc6b517d";
  43. const PLATFORM_CODE = "FlfAppPlatformCodeX9kR7mT3wQ5vZ8nB1jY6pD4sL0hC2gA";
  44. function uploadGps(data) {
  45. return request({
  46. url: "/fulfiller/fulfiller/gps",
  47. method: "POST",
  48. data
  49. });
  50. }
  51. function getMyProfile() {
  52. return request({
  53. url: "/fulfiller/fulfiller/my",
  54. method: "GET"
  55. });
  56. }
  57. function updateAvatar(avatar) {
  58. return request({
  59. url: "/fulfiller/fulfiller/my/avatar",
  60. method: "PUT",
  61. data: { avatar }
  62. });
  63. }
  64. function updateName(name) {
  65. return request({
  66. url: "/fulfiller/fulfiller/my/name",
  67. method: "PUT",
  68. data: { name }
  69. });
  70. }
  71. function updateStatus(status) {
  72. return request({
  73. url: "/fulfiller/fulfiller/my/status",
  74. method: "PUT",
  75. data: { status }
  76. });
  77. }
  78. function updateCity(data) {
  79. return request({
  80. url: "/fulfiller/fulfiller/my/city",
  81. method: "PUT",
  82. data
  83. });
  84. }
  85. function getAuthInfo() {
  86. return request({
  87. url: "/fulfiller/fulfiller/my/auth",
  88. method: "GET"
  89. });
  90. }
  91. function updatePhone(phone, code) {
  92. return request({
  93. url: "/fulfiller/fulfiller/my/phone",
  94. method: "PUT",
  95. data: { phone, code }
  96. });
  97. }
  98. function updatePassword(oldPassword, newPassword) {
  99. return request({
  100. url: "/fulfiller/fulfiller/my/password",
  101. method: "PUT",
  102. data: { oldPassword, newPassword }
  103. });
  104. }
  105. function deleteAccount() {
  106. return request({
  107. url: "/fulfiller/fulfiller/my/account",
  108. method: "DELETE"
  109. });
  110. }
  111. function updateAuthInfo(data) {
  112. return request({
  113. url: "/fulfiller/fulfiller/my/auth",
  114. method: "POST",
  115. data
  116. });
  117. }
  118. let gpsTimer = null;
  119. function reportGps(manual = false) {
  120. return new Promise((resolve, reject) => {
  121. uni.getLocation({
  122. type: "wgs84",
  123. success: function(res) {
  124. const data = {
  125. longitude: res.longitude,
  126. latitude: res.latitude
  127. };
  128. uploadGps(data).then(() => {
  129. formatAppLog("log", "at utils/gps.js:21", "GPS定位上传成功", data);
  130. resolve(res);
  131. }).catch((err) => {
  132. formatAppLog("error", "at utils/gps.js:24", "GPS定位上传失败", err);
  133. reject(err);
  134. });
  135. },
  136. fail: function(err) {
  137. formatAppLog("error", "at utils/gps.js:29", "获取GPS定位失败", err);
  138. if (manual) {
  139. checkAndRequestPermission(reject);
  140. } else {
  141. reject(err);
  142. }
  143. }
  144. });
  145. });
  146. }
  147. function checkAndRequestPermission(reject) {
  148. uni.getSetting({
  149. success(res) {
  150. if (!res.authSetting["scope.userLocation"]) {
  151. uni.showModal({
  152. title: "定位未授权",
  153. content: "请开启定位权限,以便为您推荐附近的订单并记录服务轨迹",
  154. confirmText: "去设置",
  155. success: (modalRes) => {
  156. if (modalRes.confirm) {
  157. uni.openSetting({
  158. success: (settingRes) => {
  159. if (settingRes.authSetting["scope.userLocation"]) {
  160. reportGps(true);
  161. }
  162. }
  163. });
  164. } else {
  165. if (reject)
  166. reject(new Error("User denied location permission"));
  167. }
  168. }
  169. });
  170. } else {
  171. uni.showToast({ title: "获取定位失败,请检查手机GPS是否开启", icon: "none" });
  172. if (reject)
  173. reject(new Error("Location failed even with permission"));
  174. }
  175. }
  176. });
  177. }
  178. function startGpsTimer() {
  179. const isEnabled = uni.getStorageSync("GPS_REPORT_ENABLED");
  180. if (isEnabled === false) {
  181. stopGpsTimer();
  182. return;
  183. }
  184. stopGpsTimer();
  185. reportGps();
  186. gpsTimer = setInterval(() => {
  187. reportGps();
  188. }, 12e5);
  189. }
  190. function stopGpsTimer() {
  191. if (gpsTimer) {
  192. clearInterval(gpsTimer);
  193. gpsTimer = null;
  194. }
  195. }
  196. const TOKEN_KEY = "fulfiller_token";
  197. const USER_INFO_KEY = "fulfiller_user_info";
  198. function getToken() {
  199. return uni.getStorageSync(TOKEN_KEY) || "";
  200. }
  201. function setToken(token) {
  202. uni.setStorageSync(TOKEN_KEY, token);
  203. }
  204. function removeToken() {
  205. uni.removeStorageSync(TOKEN_KEY);
  206. }
  207. function isLoggedIn() {
  208. return !!getToken();
  209. }
  210. function removeUserInfo() {
  211. uni.removeStorageSync(USER_INFO_KEY);
  212. }
  213. function clearAuth() {
  214. removeToken();
  215. removeUserInfo();
  216. stopGpsTimer();
  217. }
  218. function request(options = {}) {
  219. const {
  220. url,
  221. method = "GET",
  222. data,
  223. header = {},
  224. needToken = true
  225. } = options;
  226. const headers = {
  227. "Content-Type": "application/json;charset=utf-8",
  228. "clientid": CLIENT_ID,
  229. "X-Platform-Code": PLATFORM_CODE,
  230. ...header
  231. };
  232. if (needToken) {
  233. const token = getToken();
  234. if (token) {
  235. headers["Authorization"] = "Bearer " + token;
  236. }
  237. }
  238. return new Promise((resolve, reject) => {
  239. uni.request({
  240. url: BASE_URL + url,
  241. method: method.toUpperCase(),
  242. data,
  243. header: headers,
  244. timeout: 6e5,
  245. success: (res) => {
  246. formatAppLog("log", "at utils/request.js:51", res);
  247. const statusCode = res.statusCode;
  248. const code = res.data.code;
  249. const msg = res.data.msg;
  250. res.data.data;
  251. if (statusCode !== 200) {
  252. const errorMsg = msg || `请求失败(${statusCode})`;
  253. uni.showToast({ title: errorMsg, icon: "none" });
  254. return reject(new Error(errorMsg));
  255. }
  256. if (code === 401) {
  257. clearAuth();
  258. uni.showToast({ title: "登录已过期,请重新登录", icon: "none" });
  259. setTimeout(() => {
  260. uni.reLaunch({ url: "/pages/login/login" });
  261. }, 1500);
  262. return reject(new Error("未授权"));
  263. }
  264. if (code !== void 0 && code !== 200) {
  265. const errorMsg = msg || "操作失败";
  266. uni.showToast({ title: errorMsg, icon: "none" });
  267. return reject(new Error(errorMsg));
  268. }
  269. resolve(res.data);
  270. },
  271. fail: (err) => {
  272. uni.showToast({ title: "网络异常,请稍后重试", icon: "none" });
  273. reject(err);
  274. }
  275. });
  276. });
  277. }
  278. function loginByPassword(username, password) {
  279. return request({
  280. url: "/auth/login",
  281. method: "POST",
  282. needToken: false,
  283. data: {
  284. userSource: 1,
  285. username,
  286. password,
  287. clientId: CLIENT_ID,
  288. grantType: "password",
  289. source: 1
  290. }
  291. });
  292. }
  293. function logout() {
  294. return request({
  295. url: "/auth/logout",
  296. method: "POST"
  297. });
  298. }
  299. function getAgreement(id) {
  300. return request({
  301. url: "/system/agreement/" + id,
  302. method: "get"
  303. });
  304. }
  305. function getAppSetting(id) {
  306. return request({
  307. url: "/system/appSetting/" + id,
  308. method: "get"
  309. });
  310. }
  311. const logic$9 = {
  312. data() {
  313. return {
  314. currentTab: 1,
  315. // 0: 免密, 1: 密码
  316. mobile: "",
  317. code: "",
  318. password: "",
  319. showPassword: false,
  320. isAgreed: false,
  321. countDown: 0,
  322. timer: null,
  323. showAgreementModal: false,
  324. agreementTitle: "",
  325. // 协议标题
  326. agreementContent: "",
  327. // 协议内容
  328. loginLoading: false,
  329. loginIconUrl: "/static/logo.png",
  330. // 登录图标
  331. loginBackgroundUrl: "/static/header.png"
  332. // 登录背景
  333. };
  334. },
  335. async onLoad() {
  336. uni.removeStorageSync("recruit_form_data");
  337. uni.removeStorageSync("recruit_auth_data");
  338. uni.removeStorageSync("recruit_qual_data");
  339. await this.fetchAppSetting();
  340. },
  341. methods: {
  342. /**
  343. * 获取应用配置
  344. */
  345. async fetchAppSetting() {
  346. try {
  347. const res = await getAppSetting(1);
  348. if (res.code === 200 && res.data) {
  349. if (res.data.loginIconUrl) {
  350. this.loginIconUrl = res.data.loginIconUrl;
  351. }
  352. if (res.data.loginBackgroundUrl) {
  353. this.loginBackgroundUrl = res.data.loginBackgroundUrl;
  354. }
  355. }
  356. } catch (err) {
  357. formatAppLog("error", "at pages/login/logic.js:52", "获取应用配置失败:", err);
  358. }
  359. },
  360. /**
  361. * 显示协议弹窗
  362. * @param {Number} id 协议ID (1: 用户服务协议, 2: 隐私政策)
  363. */
  364. async showAgreement(id) {
  365. try {
  366. uni.showLoading({ title: "加载中..." });
  367. const res = await getAgreement(id);
  368. if (res.code === 200 && res.data) {
  369. this.agreementTitle = res.data.title;
  370. this.agreementContent = res.data.content;
  371. this.showAgreementModal = true;
  372. } else {
  373. uni.showToast({ title: res.msg || "获取协议失败", icon: "none" });
  374. }
  375. } catch (err) {
  376. formatAppLog("error", "at pages/login/logic.js:71", "获取协议详情失败:", err);
  377. } finally {
  378. uni.hideLoading();
  379. }
  380. },
  381. /* async getVerifyCode() {
  382. if (this.currentTab === 1) return;
  383. if (this.countDown > 0) return;
  384. if (!this.mobile || this.mobile.length !== 11) {
  385. uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
  386. return;
  387. }
  388. try {
  389. const res = await sendSmsCode(this.mobile);
  390. // 发送成功,启动倒计时
  391. this.countDown = 60;
  392. this.timer = setInterval(() => {
  393. this.countDown--;
  394. if (this.countDown <= 0) {
  395. clearInterval(this.timer);
  396. }
  397. }, 1000);
  398. // TODO 【生产环境必须删除】开发模式下后端会返回验证码,自动填入方便测试
  399. const devCode = res.data;
  400. if (devCode) {
  401. this.code = devCode;
  402. uni.showToast({ title: '验证码: ' + devCode, icon: 'none', duration: 3000 });
  403. } else {
  404. uni.showToast({ title: '验证码已发送', icon: 'none' });
  405. }
  406. } catch (err) {
  407. __f__('error','at pages/login/logic.js:103','发送验证码失败:', err);
  408. }
  409. }, */
  410. async handleLogin() {
  411. var _a;
  412. if (!this.isAgreed) {
  413. uni.showToast({ title: "请先同意用户协议", icon: "none" });
  414. return;
  415. }
  416. if (!this.mobile) {
  417. uni.showToast({ title: "请输入手机号", icon: "none" });
  418. return;
  419. }
  420. if (!this.password) {
  421. uni.showToast({ title: "请输入密码", icon: "none" });
  422. return;
  423. }
  424. if (this.loginLoading)
  425. return;
  426. this.loginLoading = true;
  427. uni.showLoading({
  428. title: "登录中...",
  429. mask: true
  430. });
  431. try {
  432. let res;
  433. res = await loginByPassword(this.mobile, this.password);
  434. const token = ((_a = res.data) == null ? void 0 : _a.access_token) || res.access_token;
  435. if (token) {
  436. setToken(token);
  437. }
  438. startGpsTimer();
  439. uni.showToast({ title: "登录成功", icon: "success" });
  440. setTimeout(() => {
  441. uni.switchTab({
  442. url: "/pages/home/index"
  443. });
  444. }, 1e3);
  445. } catch (err) {
  446. formatAppLog("error", "at pages/login/logic.js:168", "登录失败:", err);
  447. } finally {
  448. this.loginLoading = false;
  449. uni.hideLoading();
  450. }
  451. },
  452. goToRecruit() {
  453. uni.navigateTo({
  454. url: "/pages/recruit/landing"
  455. });
  456. },
  457. goToForgotPwd() {
  458. uni.navigateTo({
  459. url: "/pages/login/reset-pwd-verify"
  460. });
  461. }
  462. }
  463. };
  464. const _export_sfc = (sfc, props) => {
  465. const target = sfc.__vccOpts || sfc;
  466. for (const [key, val] of props) {
  467. target[key] = val;
  468. }
  469. return target;
  470. };
  471. const _sfc_main$E = {
  472. name: "Agreement",
  473. props: {
  474. visible: {
  475. type: Boolean,
  476. default: false
  477. },
  478. title: {
  479. type: String,
  480. default: ""
  481. },
  482. content: {
  483. type: String,
  484. default: ""
  485. }
  486. },
  487. methods: {
  488. /**
  489. * 关闭弹窗
  490. */
  491. handleClose() {
  492. this.$emit("close");
  493. }
  494. }
  495. };
  496. function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
  497. return $props.visible ? (vue.openBlock(), vue.createElementBlock(
  498. "view",
  499. {
  500. key: 0,
  501. class: "agreement-mask",
  502. onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers(() => {
  503. }, ["stop", "prevent"]))
  504. },
  505. [
  506. vue.createElementVNode("view", { class: "agreement-container" }, [
  507. vue.createElementVNode("view", { class: "agreement-header" }, [
  508. vue.createElementVNode(
  509. "text",
  510. { class: "agreement-title" },
  511. vue.toDisplayString($props.title || "协议详情"),
  512. 1
  513. /* TEXT */
  514. )
  515. ]),
  516. vue.createElementVNode("scroll-view", {
  517. "scroll-y": "",
  518. class: "agreement-body"
  519. }, [
  520. vue.createElementVNode("rich-text", { nodes: $props.content }, null, 8, ["nodes"])
  521. ]),
  522. vue.createElementVNode("view", { class: "agreement-footer" }, [
  523. vue.createElementVNode("button", {
  524. class: "confirm-btn",
  525. onClick: _cache[0] || (_cache[0] = (...args) => $options.handleClose && $options.handleClose(...args))
  526. }, "确 定")
  527. ])
  528. ])
  529. ],
  530. 32
  531. /* NEED_HYDRATION */
  532. )) : vue.createCommentVNode("v-if", true);
  533. }
  534. const Agreement = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-c8509778"], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/components/agreement/index.vue"]]);
  535. const _sfc_main$D = {
  536. ...logic$9,
  537. components: {
  538. Agreement
  539. }
  540. };
  541. function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
  542. const _component_agreement = vue.resolveComponent("agreement");
  543. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  544. vue.createElementVNode("view", { class: "banner-area" }, [
  545. vue.createElementVNode("image", {
  546. class: "banner-img",
  547. src: _ctx.loginBackgroundUrl,
  548. mode: "widthFix"
  549. }, null, 8, ["src"])
  550. ]),
  551. vue.createElementVNode("view", { class: "content-card" }, [
  552. vue.createElementVNode("view", { class: "logo-wrapper" }, [
  553. vue.createElementVNode("image", {
  554. class: "logo-img",
  555. src: _ctx.loginIconUrl,
  556. mode: "widthFix"
  557. }, null, 8, ["src"])
  558. ]),
  559. vue.createElementVNode("view", { class: "tabs" }, [
  560. vue.createElementVNode("view", { class: "tab-item active" }, [
  561. vue.createElementVNode("text", { class: "tab-text" }, "密码登录"),
  562. vue.createElementVNode("view", { class: "tab-indicator" })
  563. ])
  564. ]),
  565. vue.createElementVNode("view", { class: "form-area" }, [
  566. vue.createElementVNode("view", { class: "input-group" }, [
  567. vue.createElementVNode("view", { class: "area-code" }, [
  568. vue.createElementVNode("text", null, "+86"),
  569. vue.createElementVNode("text", { class: "arrow" }, "﹀")
  570. ]),
  571. vue.withDirectives(vue.createElementVNode(
  572. "input",
  573. {
  574. class: "input",
  575. type: "number",
  576. placeholder: "手机号",
  577. "placeholder-style": "color: #ccc",
  578. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.mobile = $event),
  579. maxlength: "11"
  580. },
  581. null,
  582. 512
  583. /* NEED_PATCH */
  584. ), [
  585. [vue.vModelText, _ctx.mobile]
  586. ])
  587. ]),
  588. vue.createElementVNode("view", { class: "input-group" }, [
  589. vue.withDirectives(vue.createElementVNode("input", {
  590. class: "input",
  591. password: !_ctx.showPassword,
  592. type: "text",
  593. placeholder: "请输入密码",
  594. "placeholder-style": "color: #ccc",
  595. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.password = $event)
  596. }, null, 8, ["password"]), [
  597. [vue.vModelText, _ctx.password]
  598. ]),
  599. vue.createElementVNode("view", {
  600. class: "eye-icon",
  601. onClick: _cache[2] || (_cache[2] = ($event) => _ctx.showPassword = !_ctx.showPassword)
  602. }, [
  603. _ctx.showPassword ? (vue.openBlock(), vue.createElementBlock("svg", {
  604. key: 0,
  605. class: "svg-icon",
  606. viewBox: "0 0 24 24",
  607. fill: "none",
  608. xmlns: "http://www.w3.org/2000/svg"
  609. }, [
  610. vue.createElementVNode("path", {
  611. d: "M12 4.5C7 4.5 2.73 7.61 1 12C2.73 16.39 7 19.5 12 19.5C17 19.5 21.27 16.39 23 12C21.27 7.61 17 4.5 12 4.5ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM12 9C10.34 9 9 10.34 9 12C9 13.66 10.34 15 12 15C13.66 15 15 13.66 15 12C15 10.34 13.66 9 12 9Z",
  612. fill: "#CCCCCC"
  613. })
  614. ])) : (vue.openBlock(), vue.createElementBlock("svg", {
  615. key: 1,
  616. class: "svg-icon",
  617. viewBox: "0 0 24 24",
  618. fill: "none",
  619. xmlns: "http://www.w3.org/2000/svg"
  620. }, [
  621. vue.createElementVNode("path", {
  622. d: "M12 7C7 7 2.73 10.11 1 14.5",
  623. stroke: "#CCCCCC",
  624. "stroke-width": "2",
  625. "stroke-linecap": "round"
  626. }),
  627. vue.createElementVNode("path", {
  628. d: "M23 14.5C21.27 10.11 17 7 12 7",
  629. stroke: "#CCCCCC",
  630. "stroke-width": "2",
  631. "stroke-linecap": "round"
  632. }),
  633. vue.createElementVNode("path", {
  634. d: "M12 7V4",
  635. stroke: "#CCCCCC",
  636. "stroke-width": "2",
  637. "stroke-linecap": "round"
  638. }),
  639. vue.createElementVNode("path", {
  640. d: "M16 8L18 5",
  641. stroke: "#CCCCCC",
  642. "stroke-width": "2",
  643. "stroke-linecap": "round"
  644. }),
  645. vue.createElementVNode("path", {
  646. d: "M8 8L6 5",
  647. stroke: "#CCCCCC",
  648. "stroke-width": "2",
  649. "stroke-linecap": "round"
  650. }),
  651. vue.createElementVNode("path", {
  652. d: "M20 10L22 8",
  653. stroke: "#CCCCCC",
  654. "stroke-width": "2",
  655. "stroke-linecap": "round"
  656. }),
  657. vue.createElementVNode("path", {
  658. d: "M4 10L2 8",
  659. stroke: "#CCCCCC",
  660. "stroke-width": "2",
  661. "stroke-linecap": "round"
  662. })
  663. ]))
  664. ])
  665. ]),
  666. vue.createElementVNode("button", {
  667. class: "login-btn",
  668. onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleLogin && _ctx.handleLogin(...args))
  669. }, "登 录"),
  670. vue.createElementVNode("view", { class: "agreement" }, [
  671. vue.createElementVNode(
  672. "view",
  673. {
  674. class: vue.normalizeClass(["checkbox", { checked: _ctx.isAgreed }]),
  675. onClick: _cache[4] || (_cache[4] = ($event) => _ctx.isAgreed = !_ctx.isAgreed)
  676. },
  677. [
  678. _ctx.isAgreed ? (vue.openBlock(), vue.createElementBlock("text", {
  679. key: 0,
  680. class: "check-mark"
  681. }, "✓")) : vue.createCommentVNode("v-if", true)
  682. ],
  683. 2
  684. /* CLASS */
  685. ),
  686. vue.createElementVNode("text", { class: "agree-text" }, [
  687. vue.createTextVNode(" 我已经阅读并同意 "),
  688. vue.createElementVNode("text", {
  689. class: "link",
  690. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => _ctx.showAgreement(1), ["stop"]))
  691. }, "《用户服务协议》"),
  692. vue.createTextVNode(" 和 "),
  693. vue.createElementVNode("text", {
  694. class: "link",
  695. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => _ctx.showAgreement(2), ["stop"]))
  696. }, "《隐私政策》")
  697. ])
  698. ])
  699. ]),
  700. vue.createElementVNode("view", {
  701. class: "footer-recruit",
  702. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.goToRecruit && _ctx.goToRecruit(...args))
  703. }, [
  704. vue.createElementVNode("view", { class: "recruit-badge" }, [
  705. (vue.openBlock(), vue.createElementBlock("svg", {
  706. class: "svg-icon flag-icon",
  707. viewBox: "0 0 24 24",
  708. fill: "none",
  709. xmlns: "http://www.w3.org/2000/svg",
  710. style: { "width": "30rpx", "height": "30rpx" }
  711. }, [
  712. vue.createElementVNode("path", {
  713. d: "M4 14V4H18L17 9L18 14H4Z",
  714. stroke: "#FF5722",
  715. "stroke-width": "2",
  716. "stroke-linejoin": "round"
  717. }),
  718. vue.createElementVNode("path", {
  719. d: "M4 22V14",
  720. stroke: "#FF5722",
  721. "stroke-width": "2",
  722. "stroke-linecap": "round"
  723. })
  724. ])),
  725. vue.createElementVNode("text", null, " 宠宝履约者招募")
  726. ])
  727. ]),
  728. vue.createVNode(_component_agreement, {
  729. visible: _ctx.showAgreementModal,
  730. title: _ctx.agreementTitle,
  731. content: _ctx.agreementContent,
  732. onClose: _cache[8] || (_cache[8] = ($event) => _ctx.showAgreementModal = false)
  733. }, null, 8, ["visible", "title", "content"])
  734. ])
  735. ]);
  736. }
  737. const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/login/login.vue"]]);
  738. const logic$8 = {
  739. data() {
  740. return {
  741. statusBarHeight: 20
  742. // 默认状态栏高度
  743. };
  744. },
  745. onLoad() {
  746. const sysInfo = uni.getSystemInfoSync();
  747. this.statusBarHeight = sysInfo.statusBarHeight || 20;
  748. },
  749. methods: {
  750. goBack() {
  751. const pages = getCurrentPages();
  752. if (pages.length > 1) {
  753. uni.navigateBack();
  754. } else {
  755. uni.reLaunch({
  756. url: "/pages/login/login"
  757. });
  758. }
  759. },
  760. goToForm() {
  761. uni.navigateTo({
  762. url: "/pages/recruit/form"
  763. });
  764. }
  765. }
  766. };
  767. const _sfc_main$C = logic$8;
  768. function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
  769. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  770. vue.createElementVNode(
  771. "view",
  772. {
  773. style: vue.normalizeStyle({ height: _ctx.statusBarHeight + "px" })
  774. },
  775. null,
  776. 4
  777. /* STYLE */
  778. ),
  779. vue.createElementVNode("view", { class: "nav-bar" }, [
  780. vue.createElementVNode("view", {
  781. class: "back-icon",
  782. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.goBack && _ctx.goBack(...args))
  783. }, "‹")
  784. ]),
  785. vue.createElementVNode("view", { class: "header-area" }, [
  786. vue.createElementVNode("text", { class: "main-title" }, "加入宠宝履约者"),
  787. vue.createElementVNode("text", { class: "sub-title" }, "月薪最高可达1.5万元")
  788. ]),
  789. vue.createElementVNode("view", { class: "content-card" }, [
  790. vue.createElementVNode("view", { class: "benefit-item" }, [
  791. vue.createElementVNode("view", { class: "icon-circle icon-money" }, [
  792. vue.createElementVNode("text", { class: "icon-text" }, "¥")
  793. ]),
  794. vue.createElementVNode("view", { class: "info" }, [
  795. vue.createElementVNode("text", { class: "item-title" }, "1、收入可观"),
  796. vue.createElementVNode("text", { class: "item-desc" }, "小默配送为您提供一种全新的赚钱选择,利用空闲时间,获得更多收入。")
  797. ])
  798. ]),
  799. vue.createElementVNode("view", { class: "benefit-item" }, [
  800. vue.createElementVNode("view", { class: "icon-circle icon-loc" }, [
  801. vue.createElementVNode("text", { class: "icon-text" }, "📍")
  802. ]),
  803. vue.createElementVNode("view", { class: "info" }, [
  804. vue.createElementVNode("text", { class: "item-title" }, "2、地点灵活"),
  805. vue.createElementVNode("text", { class: "item-desc" }, "小默配送覆盖国内各城市与港澳台等地,您可随时就近使用。")
  806. ])
  807. ]),
  808. vue.createElementVNode("view", { class: "benefit-item" }, [
  809. vue.createElementVNode("view", { class: "icon-circle icon-clock" }, [
  810. vue.createElementVNode("text", { class: "icon-text" }, "🕒")
  811. ]),
  812. vue.createElementVNode("view", { class: "info" }, [
  813. vue.createElementVNode("text", { class: "item-title" }, "3、时间自由"),
  814. vue.createElementVNode("text", { class: "item-desc" }, "不必再受繁琐事务约束,加入小默配送,自由分配个人时间,为自己工作。")
  815. ])
  816. ])
  817. ]),
  818. vue.createElementVNode("view", { class: "footer-area" }, [
  819. vue.createElementVNode("button", {
  820. class: "join-btn",
  821. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.goToForm && _ctx.goToForm(...args))
  822. }, "我要加入"),
  823. vue.createElementVNode("view", { class: "faq" }, [
  824. vue.createElementVNode("text", { class: "help-icon" }, "?"),
  825. vue.createTextVNode(" 常见问题 ")
  826. ])
  827. ])
  828. ]);
  829. }
  830. const PagesRecruitLanding = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/recruit/landing.vue"]]);
  831. function getAreaStationList() {
  832. return request({
  833. url: "/system/areaStation/list",
  834. method: "GET"
  835. });
  836. }
  837. function listAllService() {
  838. return request({
  839. url: "/service/list/listAll",
  840. method: "GET"
  841. });
  842. }
  843. const logic$7 = {
  844. data() {
  845. return {
  846. formData: {
  847. mobile: "",
  848. code: "",
  849. name: "",
  850. gender: 1,
  851. // 1男 2女
  852. birthday: "",
  853. password: "",
  854. serviceType: [],
  855. station: "",
  856. stationId: null,
  857. areaPath: ""
  858. // 用于回显“区域+站点”名称
  859. },
  860. showPwd: false,
  861. isAgreed: false,
  862. serviceTypes: [],
  863. // 验证码倒计时
  864. countDown: 0,
  865. timer: null,
  866. // 日期选择器相关
  867. showPicker: false,
  868. years: [],
  869. months: [],
  870. days: [],
  871. pickerValue: [0, 0, 0],
  872. tempYear: 0,
  873. tempMonth: 0,
  874. tempDay: 0,
  875. // 站点选择器(级联版)
  876. showStationPickerCascader: false,
  877. selectStep: 0,
  878. selectedPathway: [],
  879. currentList: [],
  880. fullStationData: [],
  881. // 全量数据
  882. selectedStationId: null,
  883. // 协议弹窗
  884. showPrivacy: false,
  885. agreementTitle: "",
  886. // 协议标题
  887. agreementContent: "",
  888. // 协议内容
  889. currentAgreementId: ""
  890. // 当前协议ID
  891. };
  892. },
  893. onLoad() {
  894. this.initDateData();
  895. this.loadServiceTypes();
  896. this.loadAreaStationData();
  897. this.restoreFormData();
  898. },
  899. beforeDestroy() {
  900. if (this.timer)
  901. clearInterval(this.timer);
  902. },
  903. methods: {
  904. async loadAreaStationData() {
  905. try {
  906. const res = await getAreaStationList();
  907. this.fullStationData = res.data || [];
  908. } catch (err) {
  909. formatAppLog("error", "at pages/recruit/logic.js:73", "加载站点列表失败:", err);
  910. }
  911. },
  912. restoreFormData() {
  913. try {
  914. const saved = uni.getStorageSync("recruit_form_data");
  915. if (saved) {
  916. const d = JSON.parse(saved);
  917. Object.assign(this.formData, d);
  918. if (d._selectedPathway) {
  919. this.selectedPathway = d._selectedPathway;
  920. this.selectStep = this.selectedPathway.length;
  921. }
  922. if (this.selectedPathway.length > 0) {
  923. const last = this.selectedPathway[this.selectedPathway.length - 1];
  924. if (last)
  925. this.loadStations(last.id);
  926. }
  927. }
  928. } catch (e) {
  929. formatAppLog("error", "at pages/recruit/logic.js:95", "恢复表单数据失败", e);
  930. }
  931. },
  932. initDateData() {
  933. const now = /* @__PURE__ */ new Date();
  934. const currentYear = now.getFullYear();
  935. for (let i = 1980; i <= currentYear + 5; i++) {
  936. this.years.push(i);
  937. }
  938. for (let i = 1; i <= 12; i++) {
  939. this.months.push(i);
  940. }
  941. for (let i = 1; i <= 31; i++) {
  942. this.days.push(i);
  943. }
  944. },
  945. // 打开选择器
  946. openPicker() {
  947. const dateStr = this.formData.birthday || "2000-01-01";
  948. const [y, m, d] = dateStr.split("-").map(Number);
  949. const yIndex = this.years.indexOf(y);
  950. const mIndex = this.months.indexOf(m);
  951. const dIndex = this.days.indexOf(d);
  952. this.pickerValue = [
  953. yIndex > -1 ? yIndex : 0,
  954. mIndex > -1 ? mIndex : 0,
  955. dIndex > -1 ? dIndex : 0
  956. ];
  957. this.tempYear = this.years[this.pickerValue[0]];
  958. this.tempMonth = this.months[this.pickerValue[1]];
  959. this.tempDay = this.days[this.pickerValue[2]];
  960. this.showPicker = true;
  961. },
  962. closePicker() {
  963. this.showPicker = false;
  964. },
  965. onPickerChange(e) {
  966. const val = e.detail.value;
  967. this.tempYear = this.years[val[0]];
  968. this.tempMonth = this.months[val[1]];
  969. this.tempDay = this.days[val[2]];
  970. },
  971. confirmPicker() {
  972. const mStr = this.tempMonth < 10 ? "0" + this.tempMonth : this.tempMonth;
  973. const dStr = this.tempDay < 10 ? "0" + this.tempDay : this.tempDay;
  974. this.formData.birthday = `${this.tempYear}-${mStr}-${dStr}`;
  975. this.closePicker();
  976. },
  977. async loadServiceTypes() {
  978. try {
  979. const res = await listAllService();
  980. this.serviceTypes = (res.data || []).map((item) => ({
  981. id: item.id,
  982. name: item.name
  983. }));
  984. } catch (err) {
  985. formatAppLog("error", "at pages/recruit/logic.js:167", "加载服务类型失败:", err);
  986. this.serviceTypes = [];
  987. }
  988. },
  989. toggleService(item) {
  990. const idx = this.formData.serviceType.indexOf(item.id);
  991. if (idx > -1) {
  992. this.formData.serviceType.splice(idx, 1);
  993. } else {
  994. this.formData.serviceType.push(item.id);
  995. }
  996. },
  997. // 验证码
  998. /* async getVerifyCode() {
  999. if (this.countDown > 0) return;
  1000. if (!this.formData.mobile || this.formData.mobile.length !== 11) {
  1001. uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
  1002. return;
  1003. }
  1004. try {
  1005. const res = await sendSmsCode(this.formData.mobile);
  1006. this.countDown = 60;
  1007. this.timer = setInterval(() => {
  1008. this.countDown--;
  1009. if (this.countDown <= 0) clearInterval(this.timer);
  1010. }, 1000);
  1011. // TODO 【生产环境必须删除】开发模式自动填入验证码
  1012. const devCode = res.data;
  1013. if (devCode) {
  1014. this.formData.code = devCode;
  1015. uni.showToast({ title: '验证码: ' + devCode, icon: 'none', duration: 3000 });
  1016. } else {
  1017. uni.showToast({ title: '验证码已发送', icon: 'none' });
  1018. }
  1019. } catch (err) {
  1020. __f__('error','at pages/recruit/logic.js:204','发送验证码失败:', err);
  1021. }
  1022. }, */
  1023. // 站点级联选择逻辑 (从全量本地数据中根据 parentId 过滤)
  1024. async openStationPickerCascader() {
  1025. this.showStationPickerCascader = true;
  1026. if (this.selectedPathway.length === 0) {
  1027. await this.resetStationPicker();
  1028. }
  1029. },
  1030. async resetStationPicker() {
  1031. this.selectStep = 0;
  1032. this.selectedPathway = [];
  1033. this.filterLocalChildren(0);
  1034. },
  1035. closeStationPickerCascader() {
  1036. this.showStationPickerCascader = false;
  1037. },
  1038. filterLocalChildren(parentId) {
  1039. this.currentList = this.fullStationData.filter((item) => item.parentId == parentId);
  1040. },
  1041. async selectStationItem(item) {
  1042. this.selectedPathway[this.selectStep] = item;
  1043. const sons = this.fullStationData.filter((i) => i.parentId == item.id);
  1044. if (sons.length > 0) {
  1045. this.selectStep++;
  1046. this.selectedPathway = this.selectedPathway.slice(0, this.selectStep);
  1047. this.currentList = sons;
  1048. } else {
  1049. this.confirmStation();
  1050. }
  1051. },
  1052. async jumpToStep(step) {
  1053. this.selectStep = step;
  1054. if (step === 0) {
  1055. this.filterLocalChildren(0);
  1056. } else {
  1057. const parent = this.selectedPathway[step - 1];
  1058. if (parent) {
  1059. this.filterLocalChildren(parent.id);
  1060. }
  1061. }
  1062. },
  1063. confirmStation() {
  1064. const path = this.selectedPathway.map((i) => i.name);
  1065. const stationName = path[path.length - 1];
  1066. const areaName = path.slice(0, -1).join(" ");
  1067. this.formData.station = stationName;
  1068. this.formData.stationId = this.selectedPathway[this.selectedPathway.length - 1].id;
  1069. this.formData.areaPath = areaName;
  1070. this.closeStationPickerCascader();
  1071. },
  1072. // --- 废弃的功能逻辑 (已被站点选择合并或移除) ---
  1073. /* async loadStations(parentId) { ... } */
  1074. /* openStationPicker() { ... } */
  1075. /* selectStation(item) { ... } */
  1076. /* async openCityPicker() { ... } */
  1077. /* loadAreaChildren(parentId) { ... } */
  1078. /* async selectCityItem(item) { ... } */
  1079. /* confirmCity() { ... } */
  1080. async openPrivacy() {
  1081. try {
  1082. uni.showLoading({ title: "加载中..." });
  1083. const res = await getAgreement(3);
  1084. if (res.code === 200 && res.data) {
  1085. this.agreementTitle = res.data.title;
  1086. this.agreementContent = res.data.content;
  1087. this.showPrivacy = true;
  1088. } else {
  1089. uni.showToast({ title: res.msg || "获取协议失败", icon: "none" });
  1090. }
  1091. } catch (err) {
  1092. formatAppLog("error", "at pages/recruit/logic.js:287", "获取协议详情失败:", err);
  1093. } finally {
  1094. uni.hideLoading();
  1095. }
  1096. },
  1097. goToAuth() {
  1098. if (!this.isAgreed) {
  1099. uni.showToast({ title: "请勾选协议", icon: "none" });
  1100. return;
  1101. }
  1102. if (!this.formData.mobile || this.formData.mobile.length !== 11) {
  1103. uni.showToast({ title: "请输入正确的手机号", icon: "none" });
  1104. return;
  1105. }
  1106. if (!this.formData.name) {
  1107. uni.showToast({ title: "请输入姓名", icon: "none" });
  1108. return;
  1109. }
  1110. if (this.formData.serviceType.length === 0) {
  1111. uni.showToast({ title: "请选择服务类型", icon: "none" });
  1112. return;
  1113. }
  1114. if (!this.formData.stationId) {
  1115. uni.showToast({ title: "请选择所属站点", icon: "none" });
  1116. return;
  1117. }
  1118. uni.setStorageSync("recruit_form_data", JSON.stringify({
  1119. ...this.formData,
  1120. _selectedPathway: this.selectedPathway
  1121. // 私有存储,仅用于回显
  1122. }));
  1123. const selectedServices = this.serviceTypes.filter((s) => this.formData.serviceType.includes(s.id));
  1124. const services = JSON.stringify(selectedServices);
  1125. uni.navigateTo({
  1126. url: `/pages/recruit/auth?services=${encodeURIComponent(services)}`
  1127. });
  1128. }
  1129. }
  1130. };
  1131. const _sfc_main$B = {
  1132. ...logic$7,
  1133. components: {
  1134. Agreement
  1135. }
  1136. };
  1137. function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
  1138. const _component_agreement = vue.resolveComponent("agreement");
  1139. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  1140. vue.createElementVNode("view", { class: "card" }, [
  1141. vue.createElementVNode("view", { class: "form-item" }, [
  1142. vue.createElementVNode("text", { class: "label" }, "手机号"),
  1143. vue.createElementVNode("view", { class: "input-box" }, [
  1144. vue.createElementVNode("view", { class: "prefix-area" }, [
  1145. vue.createElementVNode("text", { class: "prefix" }, "+86"),
  1146. vue.createElementVNode("text", { class: "arrow-down" }, "﹀")
  1147. ]),
  1148. vue.withDirectives(vue.createElementVNode(
  1149. "input",
  1150. {
  1151. class: "input",
  1152. type: "number",
  1153. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.formData.mobile = $event)
  1154. },
  1155. null,
  1156. 512
  1157. /* NEED_PATCH */
  1158. ), [
  1159. [vue.vModelText, _ctx.formData.mobile]
  1160. ])
  1161. ])
  1162. ]),
  1163. vue.createElementVNode("view", { class: "form-item" }, [
  1164. vue.createElementVNode("text", { class: "label" }, "姓名"),
  1165. vue.createElementVNode("view", { class: "input-box" }, [
  1166. vue.withDirectives(vue.createElementVNode(
  1167. "input",
  1168. {
  1169. class: "input",
  1170. type: "text",
  1171. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.formData.name = $event)
  1172. },
  1173. null,
  1174. 512
  1175. /* NEED_PATCH */
  1176. ), [
  1177. [vue.vModelText, _ctx.formData.name]
  1178. ])
  1179. ])
  1180. ]),
  1181. vue.createElementVNode("view", { class: "form-item" }, [
  1182. vue.createElementVNode("text", { class: "label" }, "性别"),
  1183. vue.createElementVNode("view", { class: "gender-group" }, [
  1184. vue.createElementVNode("view", {
  1185. class: "radio-item",
  1186. onClick: _cache[2] || (_cache[2] = ($event) => _ctx.formData.gender = 1)
  1187. }, [
  1188. vue.createElementVNode(
  1189. "text",
  1190. {
  1191. class: vue.normalizeClass(["radio-icon", { active: _ctx.formData.gender === 1 }])
  1192. },
  1193. vue.toDisplayString(_ctx.formData.gender === 1 ? "♂" : "○"),
  1194. 3
  1195. /* TEXT, CLASS */
  1196. ),
  1197. vue.createElementVNode(
  1198. "text",
  1199. {
  1200. class: vue.normalizeClass(["radio-label", { active: _ctx.formData.gender === 1 }])
  1201. },
  1202. " 男",
  1203. 2
  1204. /* CLASS */
  1205. )
  1206. ]),
  1207. vue.createElementVNode("view", {
  1208. class: "radio-item",
  1209. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.formData.gender = 2)
  1210. }, [
  1211. vue.createElementVNode(
  1212. "text",
  1213. {
  1214. class: vue.normalizeClass(["radio-icon", { active: _ctx.formData.gender === 2 }])
  1215. },
  1216. vue.toDisplayString(_ctx.formData.gender === 2 ? "♀" : "○"),
  1217. 3
  1218. /* TEXT, CLASS */
  1219. ),
  1220. vue.createElementVNode(
  1221. "text",
  1222. {
  1223. class: vue.normalizeClass(["radio-label", { active: _ctx.formData.gender === 2 }])
  1224. },
  1225. " 女",
  1226. 2
  1227. /* CLASS */
  1228. )
  1229. ])
  1230. ])
  1231. ]),
  1232. vue.createElementVNode("view", { class: "form-item" }, [
  1233. vue.createElementVNode("text", { class: "label" }, "生日"),
  1234. vue.createElementVNode("view", {
  1235. class: "input-box",
  1236. onClick: _cache[4] || (_cache[4] = (...args) => _ctx.openPicker && _ctx.openPicker(...args))
  1237. }, [
  1238. vue.createElementVNode(
  1239. "text",
  1240. null,
  1241. vue.toDisplayString(_ctx.formData.birthday || "请选择生日"),
  1242. 1
  1243. /* TEXT */
  1244. ),
  1245. (vue.openBlock(), vue.createElementBlock("svg", {
  1246. class: "arrow-right",
  1247. style: { "width": "24rpx", "height": "24rpx", "margin-left": "auto" },
  1248. viewBox: "0 0 1024 1024",
  1249. version: "1.1",
  1250. xmlns: "http://www.w3.org/2000/svg"
  1251. }, [
  1252. vue.createElementVNode("path", {
  1253. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-45.056L382.592 149.312a29.12 29.12 0 0 0-41.728 0z",
  1254. fill: "#CCCCCC"
  1255. })
  1256. ]))
  1257. ])
  1258. ]),
  1259. vue.createElementVNode("view", { class: "form-item" }, [
  1260. vue.createElementVNode("text", { class: "label" }, "密码"),
  1261. vue.createElementVNode("view", { class: "input-box" }, [
  1262. vue.withDirectives(vue.createElementVNode("input", {
  1263. class: "input",
  1264. password: !_ctx.showPwd,
  1265. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.formData.password = $event),
  1266. placeholder: "设置登录密码"
  1267. }, null, 8, ["password"]), [
  1268. [vue.vModelText, _ctx.formData.password]
  1269. ]),
  1270. vue.createElementVNode("view", {
  1271. class: "monkey-icon",
  1272. onClick: _cache[6] || (_cache[6] = ($event) => _ctx.showPwd = !_ctx.showPwd)
  1273. }, [
  1274. _ctx.showPwd ? (vue.openBlock(), vue.createElementBlock("svg", {
  1275. key: 0,
  1276. class: "svg-icon",
  1277. viewBox: "0 0 24 24",
  1278. fill: "none",
  1279. xmlns: "http://www.w3.org/2000/svg"
  1280. }, [
  1281. vue.createElementVNode("path", {
  1282. d: "M12 4.5C7 4.5 2.73 7.61 1 12C2.73 16.39 7 19.5 12 19.5C17 19.5 21.27 16.39 23 12C21.27 7.61 17 4.5 12 4.5ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM12 9C10.34 9 9 10.34 9 12C9 13.66 10.34 15 12 15C13.66 15 15 13.66 15 12C15 10.34 13.66 9 12 9Z",
  1283. fill: "#CCCCCC"
  1284. })
  1285. ])) : (vue.openBlock(), vue.createElementBlock("svg", {
  1286. key: 1,
  1287. class: "svg-icon",
  1288. viewBox: "0 0 24 24",
  1289. fill: "none",
  1290. xmlns: "http://www.w3.org/2000/svg"
  1291. }, [
  1292. vue.createElementVNode("path", {
  1293. d: "M12 7C7 7 2.73 10.11 1 14.5",
  1294. stroke: "#CCCCCC",
  1295. "stroke-width": "2",
  1296. "stroke-linecap": "round"
  1297. }),
  1298. vue.createElementVNode("path", {
  1299. d: "M23 14.5C21.27 10.11 17 7 12 7",
  1300. stroke: "#CCCCCC",
  1301. "stroke-width": "2",
  1302. "stroke-linecap": "round"
  1303. }),
  1304. vue.createElementVNode("path", {
  1305. d: "M12 7V4",
  1306. stroke: "#CCCCCC",
  1307. "stroke-width": "2",
  1308. "stroke-linecap": "round"
  1309. }),
  1310. vue.createElementVNode("path", {
  1311. d: "M16 8L18 5",
  1312. stroke: "#CCCCCC",
  1313. "stroke-width": "2",
  1314. "stroke-linecap": "round"
  1315. }),
  1316. vue.createElementVNode("path", {
  1317. d: "M8 8L6 5",
  1318. stroke: "#CCCCCC",
  1319. "stroke-width": "2",
  1320. "stroke-linecap": "round"
  1321. }),
  1322. vue.createElementVNode("path", {
  1323. d: "M20 10L22 8",
  1324. stroke: "#CCCCCC",
  1325. "stroke-width": "2",
  1326. "stroke-linecap": "round"
  1327. }),
  1328. vue.createElementVNode("path", {
  1329. d: "M4 10L2 8",
  1330. stroke: "#CCCCCC",
  1331. "stroke-width": "2",
  1332. "stroke-linecap": "round"
  1333. })
  1334. ]))
  1335. ])
  1336. ])
  1337. ])
  1338. ]),
  1339. vue.createElementVNode("view", { class: "card" }, [
  1340. vue.createElementVNode("view", { class: "section-title" }, "服务类型"),
  1341. vue.createElementVNode("view", { class: "service-types" }, [
  1342. (vue.openBlock(true), vue.createElementBlock(
  1343. vue.Fragment,
  1344. null,
  1345. vue.renderList(_ctx.serviceTypes, (item, index) => {
  1346. return vue.openBlock(), vue.createElementBlock("view", {
  1347. class: vue.normalizeClass(["type-btn", { selected: _ctx.formData.serviceType.includes(item.id) }]),
  1348. key: item.id,
  1349. onClick: ($event) => _ctx.toggleService(item)
  1350. }, vue.toDisplayString(item.name), 11, ["onClick"]);
  1351. }),
  1352. 128
  1353. /* KEYED_FRAGMENT */
  1354. ))
  1355. ]),
  1356. vue.createElementVNode("view", { class: "form-item" }, [
  1357. vue.createElementVNode("text", { class: "label" }, "所属站点"),
  1358. vue.createElementVNode("view", {
  1359. class: "input-box",
  1360. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.openStationPickerCascader && _ctx.openStationPickerCascader(...args))
  1361. }, [
  1362. _ctx.formData.station ? (vue.openBlock(), vue.createElementBlock("view", {
  1363. key: 0,
  1364. class: "station-display"
  1365. }, [
  1366. _ctx.formData.areaPath ? (vue.openBlock(), vue.createElementBlock(
  1367. "text",
  1368. {
  1369. key: 0,
  1370. class: "area-tag"
  1371. },
  1372. vue.toDisplayString(_ctx.formData.areaPath),
  1373. 1
  1374. /* TEXT */
  1375. )) : vue.createCommentVNode("v-if", true),
  1376. vue.createElementVNode(
  1377. "text",
  1378. { class: "station-name" },
  1379. vue.toDisplayString(_ctx.formData.station),
  1380. 1
  1381. /* TEXT */
  1382. )
  1383. ])) : (vue.openBlock(), vue.createElementBlock("text", {
  1384. key: 1,
  1385. style: { "color": "#ccc" }
  1386. }, "请选择所属站点")),
  1387. (vue.openBlock(), vue.createElementBlock("svg", {
  1388. class: "arrow-right",
  1389. style: { "width": "24rpx", "height": "24rpx", "margin-left": "auto" },
  1390. viewBox: "0 0 1024 1024",
  1391. version: "1.1",
  1392. xmlns: "http://www.w3.org/2000/svg"
  1393. }, [
  1394. vue.createElementVNode("path", {
  1395. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-45.056L382.592 149.312a29.12 29.12 0 0 0-41.728 0z",
  1396. fill: "#CCCCCC"
  1397. })
  1398. ]))
  1399. ])
  1400. ])
  1401. ]),
  1402. vue.createElementVNode(
  1403. "view",
  1404. {
  1405. class: vue.normalizeClass(["picker-mask", { show: _ctx.showStationPickerCascader }]),
  1406. onClick: _cache[11] || (_cache[11] = (...args) => _ctx.closeStationPickerCascader && _ctx.closeStationPickerCascader(...args))
  1407. },
  1408. [
  1409. vue.createElementVNode("view", {
  1410. class: "picker-content",
  1411. onClick: _cache[10] || (_cache[10] = vue.withModifiers(() => {
  1412. }, ["stop"]))
  1413. }, [
  1414. vue.createElementVNode("view", { class: "picker-header" }, [
  1415. vue.createElementVNode("text", {
  1416. class: "picker-btn-cancel",
  1417. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.closeStationPickerCascader && _ctx.closeStationPickerCascader(...args))
  1418. }, "取消"),
  1419. vue.createElementVNode("text", { class: "picker-title" }, "请选择所属站点"),
  1420. vue.createElementVNode("text", {
  1421. class: "picker-btn-confirm",
  1422. onClick: _cache[9] || (_cache[9] = (...args) => _ctx.closeStationPickerCascader && _ctx.closeStationPickerCascader(...args))
  1423. }, "关闭")
  1424. ]),
  1425. vue.createElementVNode("view", { class: "picker-body" }, [
  1426. vue.createElementVNode("view", { class: "timeline-area" }, [
  1427. (vue.openBlock(true), vue.createElementBlock(
  1428. vue.Fragment,
  1429. null,
  1430. vue.renderList(_ctx.selectedPathway, (item, index) => {
  1431. return vue.openBlock(), vue.createElementBlock("view", {
  1432. class: "timeline-item",
  1433. key: index,
  1434. onClick: ($event) => _ctx.jumpToStep(index)
  1435. }, [
  1436. vue.createElementVNode("view", { class: "timeline-dot" }),
  1437. vue.createElementVNode(
  1438. "text",
  1439. null,
  1440. vue.toDisplayString(item.name),
  1441. 1
  1442. /* TEXT */
  1443. )
  1444. ], 8, ["onClick"]);
  1445. }),
  1446. 128
  1447. /* KEYED_FRAGMENT */
  1448. )),
  1449. _ctx.selectStep === _ctx.selectedPathway.length ? (vue.openBlock(), vue.createElementBlock("view", {
  1450. key: 0,
  1451. class: "timeline-item active"
  1452. }, [
  1453. vue.createElementVNode("view", { class: "timeline-dot" }),
  1454. vue.createElementVNode("text", null, "请选择")
  1455. ])) : vue.createCommentVNode("v-if", true)
  1456. ]),
  1457. vue.createElementVNode("scroll-view", {
  1458. "scroll-y": "",
  1459. class: "list-area"
  1460. }, [
  1461. (vue.openBlock(true), vue.createElementBlock(
  1462. vue.Fragment,
  1463. null,
  1464. vue.renderList(_ctx.currentList, (item, index) => {
  1465. return vue.openBlock(), vue.createElementBlock("view", {
  1466. class: "list-item",
  1467. key: item.id,
  1468. onClick: ($event) => _ctx.selectStationItem(item)
  1469. }, vue.toDisplayString(item.name), 9, ["onClick"]);
  1470. }),
  1471. 128
  1472. /* KEYED_FRAGMENT */
  1473. )),
  1474. _ctx.currentList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  1475. key: 0,
  1476. style: { "padding": "20rpx", "color": "#999" }
  1477. }, " 无数据 ")) : vue.createCommentVNode("v-if", true)
  1478. ])
  1479. ])
  1480. ])
  1481. ],
  1482. 2
  1483. /* CLASS */
  1484. ),
  1485. vue.createElementVNode("view", { class: "footer-actions" }, [
  1486. vue.createElementVNode("view", { class: "agreement-row" }, [
  1487. vue.createElementVNode(
  1488. "view",
  1489. {
  1490. class: vue.normalizeClass(["checkbox", { checked: _ctx.isAgreed }]),
  1491. onClick: _cache[12] || (_cache[12] = ($event) => _ctx.isAgreed = !_ctx.isAgreed)
  1492. },
  1493. [
  1494. _ctx.isAgreed ? (vue.openBlock(), vue.createElementBlock("text", {
  1495. key: 0,
  1496. class: "check-mark"
  1497. }, "✓")) : vue.createCommentVNode("v-if", true)
  1498. ],
  1499. 2
  1500. /* CLASS */
  1501. ),
  1502. vue.createElementVNode("text", { class: "agree-text" }, [
  1503. vue.createTextVNode("我已阅读并同意 "),
  1504. vue.createElementVNode("text", {
  1505. style: { "color": "#2979ff" },
  1506. onClick: _cache[13] || (_cache[13] = vue.withModifiers((...args) => _ctx.openPrivacy && _ctx.openPrivacy(...args), ["stop"]))
  1507. }, "《宠宝履约者说明》")
  1508. ])
  1509. ]),
  1510. vue.createElementVNode("view", { class: "footer-btn-area" }, [
  1511. vue.createElementVNode("button", {
  1512. class: "submit-btn",
  1513. onClick: _cache[14] || (_cache[14] = (...args) => _ctx.goToAuth && _ctx.goToAuth(...args))
  1514. }, "下一步,实名认证")
  1515. ])
  1516. ]),
  1517. vue.createElementVNode(
  1518. "view",
  1519. {
  1520. class: vue.normalizeClass(["picker-mask", { show: _ctx.showPicker }]),
  1521. onClick: _cache[19] || (_cache[19] = (...args) => _ctx.closePicker && _ctx.closePicker(...args))
  1522. },
  1523. [
  1524. vue.createElementVNode("view", {
  1525. class: "picker-content",
  1526. onClick: _cache[18] || (_cache[18] = vue.withModifiers(() => {
  1527. }, ["stop"]))
  1528. }, [
  1529. vue.createElementVNode("view", { class: "picker-header" }, [
  1530. vue.createElementVNode("text", {
  1531. class: "picker-btn-cancel",
  1532. onClick: _cache[15] || (_cache[15] = (...args) => _ctx.closePicker && _ctx.closePicker(...args))
  1533. }, "取消"),
  1534. vue.createElementVNode("text", { class: "picker-title" }, "选择出生日期"),
  1535. vue.createElementVNode("text", {
  1536. class: "picker-btn-confirm",
  1537. onClick: _cache[16] || (_cache[16] = (...args) => _ctx.confirmPicker && _ctx.confirmPicker(...args))
  1538. }, "确定")
  1539. ]),
  1540. vue.createElementVNode("picker-view", {
  1541. class: "picker-view",
  1542. "indicator-style": "height: 50px;",
  1543. value: _ctx.pickerValue,
  1544. onChange: _cache[17] || (_cache[17] = (...args) => _ctx.onPickerChange && _ctx.onPickerChange(...args))
  1545. }, [
  1546. vue.createElementVNode("picker-view-column", null, [
  1547. (vue.openBlock(true), vue.createElementBlock(
  1548. vue.Fragment,
  1549. null,
  1550. vue.renderList(_ctx.years, (item, index) => {
  1551. return vue.openBlock(), vue.createElementBlock(
  1552. "view",
  1553. {
  1554. class: "picker-item",
  1555. key: index
  1556. },
  1557. vue.toDisplayString(item) + "年",
  1558. 1
  1559. /* TEXT */
  1560. );
  1561. }),
  1562. 128
  1563. /* KEYED_FRAGMENT */
  1564. ))
  1565. ]),
  1566. vue.createElementVNode("picker-view-column", null, [
  1567. (vue.openBlock(true), vue.createElementBlock(
  1568. vue.Fragment,
  1569. null,
  1570. vue.renderList(_ctx.months, (item, index) => {
  1571. return vue.openBlock(), vue.createElementBlock(
  1572. "view",
  1573. {
  1574. class: "picker-item",
  1575. key: index
  1576. },
  1577. vue.toDisplayString(item) + "月",
  1578. 1
  1579. /* TEXT */
  1580. );
  1581. }),
  1582. 128
  1583. /* KEYED_FRAGMENT */
  1584. ))
  1585. ]),
  1586. vue.createElementVNode("picker-view-column", null, [
  1587. (vue.openBlock(true), vue.createElementBlock(
  1588. vue.Fragment,
  1589. null,
  1590. vue.renderList(_ctx.days, (item, index) => {
  1591. return vue.openBlock(), vue.createElementBlock(
  1592. "view",
  1593. {
  1594. class: "picker-item",
  1595. key: index
  1596. },
  1597. vue.toDisplayString(item) + "日",
  1598. 1
  1599. /* TEXT */
  1600. );
  1601. }),
  1602. 128
  1603. /* KEYED_FRAGMENT */
  1604. ))
  1605. ])
  1606. ], 40, ["value"])
  1607. ])
  1608. ],
  1609. 2
  1610. /* CLASS */
  1611. ),
  1612. vue.createVNode(_component_agreement, {
  1613. visible: _ctx.showPrivacy,
  1614. title: _ctx.agreementTitle,
  1615. content: _ctx.agreementContent,
  1616. onClose: _cache[20] || (_cache[20] = ($event) => _ctx.showPrivacy = false)
  1617. }, null, 8, ["visible", "title", "content"])
  1618. ]);
  1619. }
  1620. const PagesRecruitForm = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/recruit/form.vue"]]);
  1621. function submitAudit(data) {
  1622. return request({
  1623. url: "/fulfiller/app/audit/submit",
  1624. method: "POST",
  1625. needToken: false,
  1626. data
  1627. });
  1628. }
  1629. function getServiceTypes() {
  1630. return request({
  1631. url: "/fulfiller/app/service/list",
  1632. method: "GET",
  1633. needToken: false
  1634. });
  1635. }
  1636. function uploadFile(filePath) {
  1637. return new Promise((resolve, reject) => {
  1638. const token = uni.getStorageSync("fulfiller_token");
  1639. uni.uploadFile({
  1640. url: BASE_URL + "/fulfiller/app/upload",
  1641. filePath,
  1642. name: "file",
  1643. timeout: 6e5,
  1644. header: {
  1645. "clientid": CLIENT_ID,
  1646. "X-Platform-Code": PLATFORM_CODE,
  1647. "Authorization": token ? `Bearer ${token}` : ""
  1648. },
  1649. success: (res) => {
  1650. try {
  1651. const data = JSON.parse(res.data);
  1652. if (data.code === 200) {
  1653. resolve(data);
  1654. } else {
  1655. uni.showToast({ title: data.msg || "上传失败", icon: "none" });
  1656. reject(data);
  1657. }
  1658. } catch (e) {
  1659. reject(e);
  1660. }
  1661. },
  1662. fail: (err) => {
  1663. uni.showToast({ title: "上传失败", icon: "none" });
  1664. reject(err);
  1665. }
  1666. });
  1667. });
  1668. }
  1669. const logic$6 = {
  1670. data() {
  1671. return {
  1672. formData: {
  1673. idType: "居民身份证",
  1674. name: "",
  1675. idNumber: "",
  1676. expiryDate: ""
  1677. },
  1678. idCardFront: "",
  1679. // 身份证正面本地预览路径
  1680. idCardBack: "",
  1681. // 身份证反面本地预览路径
  1682. idCardFrontOssId: "",
  1683. // 身份证正面 OSS ID
  1684. idCardBackOssId: "",
  1685. // 身份证反面 OSS ID
  1686. showPicker: false,
  1687. pickerValue: [0, 0, 0],
  1688. // YYYY-MM-DD
  1689. years: [],
  1690. months: [],
  1691. days: [],
  1692. tempYear: 0,
  1693. tempMonth: 0,
  1694. tempDay: 0,
  1695. serviceType: [],
  1696. // 接收上一页的服务类型
  1697. isChoosingImage: false
  1698. // 标志位:是否正在选择图片中,防止 onShow 重置数据
  1699. };
  1700. },
  1701. onLoad(options) {
  1702. if (options.services) {
  1703. try {
  1704. this.serviceType = JSON.parse(decodeURIComponent(options.services));
  1705. } catch (e) {
  1706. formatAppLog("error", "at pages/recruit/auth_logic.js:33", "Parse services failed", e);
  1707. }
  1708. }
  1709. this.initDateData();
  1710. this.restoreAuthData();
  1711. },
  1712. onShow() {
  1713. if (this.isChoosingImage) {
  1714. this.isChoosingImage = false;
  1715. }
  1716. },
  1717. methods: {
  1718. // --- 日期选择器逻辑 ---
  1719. initDateData() {
  1720. const date = /* @__PURE__ */ new Date();
  1721. const year = date.getFullYear();
  1722. for (let i = year; i <= year + 50; i++) {
  1723. this.years.push(i);
  1724. }
  1725. for (let i = 1; i <= 12; i++) {
  1726. this.months.push(i);
  1727. }
  1728. for (let i = 1; i <= 31; i++) {
  1729. this.days.push(i);
  1730. }
  1731. },
  1732. openPicker() {
  1733. const date = /* @__PURE__ */ new Date();
  1734. const dateStr = this.formData.expiryDate || `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
  1735. const [y, m, d] = dateStr.split("-").map(Number);
  1736. let yIndex = this.years.indexOf(y);
  1737. let mIndex = this.months.indexOf(m);
  1738. let dIndex = this.days.indexOf(d);
  1739. this.pickerValue = [
  1740. yIndex > -1 ? yIndex : 0,
  1741. mIndex > -1 ? mIndex : 0,
  1742. dIndex > -1 ? dIndex : 0
  1743. ];
  1744. this.tempYear = this.years[this.pickerValue[0]];
  1745. this.tempMonth = this.months[this.pickerValue[1]];
  1746. this.tempDay = this.days[this.pickerValue[2]];
  1747. this.showPicker = true;
  1748. },
  1749. closePicker() {
  1750. this.showPicker = false;
  1751. },
  1752. onPickerChange(e) {
  1753. const val = e.detail.value;
  1754. this.tempYear = this.years[val[0]];
  1755. this.tempMonth = this.months[val[1]];
  1756. this.tempDay = this.days[val[2]];
  1757. },
  1758. confirmPicker() {
  1759. const mStr = this.tempMonth < 10 ? "0" + this.tempMonth : this.tempMonth;
  1760. const dStr = this.tempDay < 10 ? "0" + this.tempDay : this.tempDay;
  1761. this.formData.expiryDate = `${this.tempYear}-${mStr}-${dStr}`;
  1762. this.closePicker();
  1763. },
  1764. // --- 数据持久化(防止返回上一级丢失) ---
  1765. restoreAuthData() {
  1766. try {
  1767. const saved = uni.getStorageSync("recruit_auth_data");
  1768. if (saved) {
  1769. const d = JSON.parse(saved);
  1770. this.formData.name = d.name || "";
  1771. this.formData.idNumber = d.idNumber || "";
  1772. this.formData.expiryDate = d.expiryDate || "";
  1773. this.idCardFront = d.idCardFront || "";
  1774. this.idCardBack = d.idCardBack || "";
  1775. this.idCardFrontOssId = d.idCardFrontOssId || "";
  1776. this.idCardBackOssId = d.idCardBackOssId || "";
  1777. }
  1778. } catch (e) {
  1779. formatAppLog("error", "at pages/recruit/auth_logic.js:113", "恢复认证数据失败", e);
  1780. }
  1781. },
  1782. saveAuthData() {
  1783. try {
  1784. uni.setStorageSync("recruit_auth_data", JSON.stringify({
  1785. name: this.formData.name,
  1786. idNumber: this.formData.idNumber,
  1787. expiryDate: this.formData.expiryDate,
  1788. idCardFront: this.idCardFront,
  1789. idCardBack: this.idCardBack,
  1790. idCardFrontOssId: this.idCardFrontOssId,
  1791. idCardBackOssId: this.idCardBackOssId
  1792. }));
  1793. } catch (e) {
  1794. formatAppLog("error", "at pages/recruit/auth_logic.js:128", "保存认证数据失败", e);
  1795. }
  1796. },
  1797. // --- 重置表单数据 ---
  1798. resetFormData() {
  1799. this.formData.name = "";
  1800. this.formData.idNumber = "";
  1801. this.formData.expiryDate = "";
  1802. this.idCardFront = "";
  1803. this.idCardBack = "";
  1804. this.idCardFrontOssId = "";
  1805. this.idCardBackOssId = "";
  1806. try {
  1807. uni.removeStorageSync("recruit_auth_data");
  1808. } catch (e) {
  1809. formatAppLog("error", "at pages/recruit/auth_logic.js:145", "清除缓存失败", e);
  1810. }
  1811. },
  1812. // --- 图片上传(选择后自动上传到OSS) ---
  1813. chooseImage(side) {
  1814. this.isChoosingImage = true;
  1815. uni.chooseImage({
  1816. count: 1,
  1817. sizeType: ["compressed"],
  1818. sourceType: ["album", "camera"],
  1819. success: async (res) => {
  1820. const tempPath = res.tempFilePaths[0];
  1821. if (side === "front") {
  1822. this.idCardFront = tempPath;
  1823. } else {
  1824. this.idCardBack = tempPath;
  1825. }
  1826. try {
  1827. uni.showLoading({ title: "上传中..." });
  1828. const uploadRes = await uploadFile(tempPath);
  1829. if (side === "front") {
  1830. this.idCardFrontOssId = uploadRes.data.ossId;
  1831. } else {
  1832. this.idCardBackOssId = uploadRes.data.ossId;
  1833. }
  1834. uni.hideLoading();
  1835. this.saveAuthData();
  1836. } catch (err) {
  1837. uni.hideLoading();
  1838. formatAppLog("error", "at pages/recruit/auth_logic.js:176", "上传身份证图片失败:", err);
  1839. }
  1840. }
  1841. });
  1842. },
  1843. // --- 提交 ---
  1844. goToQualifications() {
  1845. this.saveAuthData();
  1846. try {
  1847. const stored = uni.getStorageSync("recruit_form_data");
  1848. if (stored) {
  1849. const data = JSON.parse(stored);
  1850. data.realName = this.formData.name;
  1851. data.idNumber = this.formData.idNumber;
  1852. data.expiryDate = this.formData.expiryDate;
  1853. data.idCardFrontOssId = this.idCardFrontOssId;
  1854. data.idCardBackOssId = this.idCardBackOssId;
  1855. uni.setStorageSync("recruit_form_data", JSON.stringify(data));
  1856. }
  1857. } catch (e) {
  1858. formatAppLog("error", "at pages/recruit/auth_logic.js:213", "保存认证数据失败", e);
  1859. }
  1860. const services = JSON.stringify(this.serviceType);
  1861. uni.navigateTo({
  1862. url: `/pages/recruit/qualifications?services=${encodeURIComponent(services)}`
  1863. });
  1864. }
  1865. }
  1866. };
  1867. const _sfc_main$A = logic$6;
  1868. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  1869. return vue.openBlock(), vue.createElementBlock("view", { class: "auth-container" }, [
  1870. vue.createElementVNode("view", { class: "top-tip" }, "请确保身份信息的准确,以免影响后续履约费用结算。"),
  1871. vue.createElementVNode("view", { class: "form-card" }, [
  1872. vue.createElementVNode("view", { class: "form-item" }, [
  1873. vue.createElementVNode("text", { class: "label" }, "证件类型"),
  1874. vue.createElementVNode("view", { class: "read-only-text" }, "居民身份证")
  1875. ]),
  1876. vue.createElementVNode("view", { class: "form-item" }, [
  1877. vue.createElementVNode("text", { class: "label" }, "真实姓名"),
  1878. vue.createElementVNode("view", { class: "gray-input-box" }, [
  1879. vue.withDirectives(vue.createElementVNode(
  1880. "input",
  1881. {
  1882. class: "input-area",
  1883. type: "text",
  1884. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.formData.name = $event),
  1885. placeholder: "证件姓名",
  1886. "placeholder-class": "input-placeholder"
  1887. },
  1888. null,
  1889. 512
  1890. /* NEED_PATCH */
  1891. ), [
  1892. [vue.vModelText, _ctx.formData.name]
  1893. ])
  1894. ])
  1895. ]),
  1896. vue.createElementVNode("view", { class: "form-item" }, [
  1897. vue.createElementVNode("text", { class: "label" }, "证件号码"),
  1898. vue.createElementVNode("view", { class: "gray-input-box" }, [
  1899. vue.withDirectives(vue.createElementVNode(
  1900. "input",
  1901. {
  1902. class: "input-area",
  1903. type: "idcard",
  1904. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.formData.idNumber = $event),
  1905. placeholder: "身份证号",
  1906. "placeholder-class": "input-placeholder"
  1907. },
  1908. null,
  1909. 512
  1910. /* NEED_PATCH */
  1911. ), [
  1912. [vue.vModelText, _ctx.formData.idNumber]
  1913. ])
  1914. ])
  1915. ]),
  1916. vue.createElementVNode("view", { class: "form-item" }, [
  1917. vue.createElementVNode("text", { class: "label" }, "有效日期"),
  1918. vue.createElementVNode("view", {
  1919. class: "gray-input-box",
  1920. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.openPicker && _ctx.openPicker(...args))
  1921. }, [
  1922. vue.createElementVNode(
  1923. "text",
  1924. {
  1925. class: vue.normalizeClass(["input-area", { "input-placeholder": !_ctx.formData.expiryDate }])
  1926. },
  1927. vue.toDisplayString(_ctx.formData.expiryDate || "选择有效结束期限"),
  1928. 3
  1929. /* TEXT, CLASS */
  1930. ),
  1931. (vue.openBlock(), vue.createElementBlock("svg", {
  1932. class: "arrow-right",
  1933. viewBox: "0 0 1024 1024",
  1934. version: "1.1",
  1935. xmlns: "http://www.w3.org/2000/svg"
  1936. }, [
  1937. vue.createElementVNode("path", {
  1938. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-45.056L382.592 149.312a29.12 29.12 0 0 0-41.728 0z",
  1939. fill: "#CCCCCC"
  1940. })
  1941. ]))
  1942. ])
  1943. ])
  1944. ]),
  1945. vue.createElementVNode("view", { class: "upload-card" }, [
  1946. vue.createElementVNode("view", {
  1947. class: "upload-box",
  1948. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.chooseImage("front"))
  1949. }, [
  1950. _ctx.idCardFront ? (vue.openBlock(), vue.createElementBlock("image", {
  1951. key: 0,
  1952. src: _ctx.idCardFront,
  1953. class: "preview-img",
  1954. mode: "aspectFill"
  1955. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock(
  1956. vue.Fragment,
  1957. { key: 1 },
  1958. [
  1959. (vue.openBlock(), vue.createElementBlock("svg", {
  1960. class: "camera-icon",
  1961. viewBox: "0 0 24 24",
  1962. fill: "none",
  1963. xmlns: "http://www.w3.org/2000/svg"
  1964. }, [
  1965. vue.createElementVNode("path", {
  1966. d: "M12 12C14.7614 12 17 9.76142 17 7C17 4.23858 14.7614 2 12 2C9.23858 2 7 4.23858 7 7C7 9.76142 9.23858 12 12 12Z",
  1967. fill: "#E0E0E0"
  1968. }),
  1969. vue.createElementVNode("circle", {
  1970. cx: "12",
  1971. cy: "12",
  1972. r: "3",
  1973. stroke: "#CCCCCC",
  1974. "stroke-width": "2"
  1975. }),
  1976. vue.createElementVNode("path", {
  1977. d: "M20 6H17.82L16.4 4.47C15.96 4 15.34 3.73 14.68 3.73H9.32C8.66 3.73 8.04 4 7.6 4.47L6.18 6H4C2.9 6 2 6.9 2 8V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17Z",
  1978. fill: "#CCCCCC"
  1979. })
  1980. ])),
  1981. vue.createElementVNode("text", { class: "upload-text" }, "点击上传")
  1982. ],
  1983. 64
  1984. /* STABLE_FRAGMENT */
  1985. ))
  1986. ]),
  1987. vue.createElementVNode("text", { class: "card-label" }, "证件带照片面")
  1988. ]),
  1989. vue.createElementVNode("view", { class: "upload-card" }, [
  1990. vue.createElementVNode("view", {
  1991. class: "upload-box",
  1992. onClick: _cache[4] || (_cache[4] = ($event) => _ctx.chooseImage("back"))
  1993. }, [
  1994. _ctx.idCardBack ? (vue.openBlock(), vue.createElementBlock("image", {
  1995. key: 0,
  1996. src: _ctx.idCardBack,
  1997. class: "preview-img",
  1998. mode: "aspectFill"
  1999. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock(
  2000. vue.Fragment,
  2001. { key: 1 },
  2002. [
  2003. (vue.openBlock(), vue.createElementBlock("svg", {
  2004. class: "camera-icon",
  2005. viewBox: "0 0 24 24",
  2006. fill: "none",
  2007. xmlns: "http://www.w3.org/2000/svg"
  2008. }, [
  2009. vue.createElementVNode("path", {
  2010. d: "M20 6H17.82L16.4 4.47C15.96 4 15.34 3.73 14.68 3.73H9.32C8.66 3.73 8.04 4 7.6 4.47L6.18 6H4C2.9 6 2 6.9 2 8V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17Z",
  2011. fill: "#CCCCCC"
  2012. })
  2013. ])),
  2014. vue.createElementVNode("text", { class: "upload-text" }, "点击上传")
  2015. ],
  2016. 64
  2017. /* STABLE_FRAGMENT */
  2018. ))
  2019. ]),
  2020. vue.createElementVNode("text", { class: "card-label" }, "证件国徽面")
  2021. ]),
  2022. vue.createElementVNode("view", { class: "footer-btn-area" }, [
  2023. vue.createElementVNode("button", {
  2024. class: "next-btn",
  2025. onClick: _cache[5] || (_cache[5] = (...args) => _ctx.goToQualifications && _ctx.goToQualifications(...args))
  2026. }, "下一步,完善资质")
  2027. ]),
  2028. vue.createElementVNode(
  2029. "view",
  2030. {
  2031. class: vue.normalizeClass(["picker-mask", { show: _ctx.showPicker }]),
  2032. onClick: _cache[10] || (_cache[10] = (...args) => _ctx.closePicker && _ctx.closePicker(...args))
  2033. },
  2034. [
  2035. vue.createElementVNode("view", {
  2036. class: "picker-content",
  2037. onClick: _cache[9] || (_cache[9] = vue.withModifiers(() => {
  2038. }, ["stop"]))
  2039. }, [
  2040. vue.createElementVNode("view", { class: "picker-header" }, [
  2041. vue.createElementVNode("text", {
  2042. class: "picker-btn-cancel",
  2043. onClick: _cache[6] || (_cache[6] = (...args) => _ctx.closePicker && _ctx.closePicker(...args))
  2044. }, "取消"),
  2045. vue.createElementVNode("text", { class: "picker-title" }, "选择有效结束期限"),
  2046. vue.createElementVNode("text", {
  2047. class: "picker-btn-confirm",
  2048. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.confirmPicker && _ctx.confirmPicker(...args))
  2049. }, "确定")
  2050. ]),
  2051. vue.createElementVNode("picker-view", {
  2052. class: "picker-view",
  2053. "indicator-style": "height: 50px;",
  2054. value: _ctx.pickerValue,
  2055. onChange: _cache[8] || (_cache[8] = (...args) => _ctx.onPickerChange && _ctx.onPickerChange(...args))
  2056. }, [
  2057. vue.createElementVNode("picker-view-column", null, [
  2058. (vue.openBlock(true), vue.createElementBlock(
  2059. vue.Fragment,
  2060. null,
  2061. vue.renderList(_ctx.years, (item, index) => {
  2062. return vue.openBlock(), vue.createElementBlock(
  2063. "view",
  2064. {
  2065. class: "picker-item",
  2066. key: index
  2067. },
  2068. vue.toDisplayString(item) + "年",
  2069. 1
  2070. /* TEXT */
  2071. );
  2072. }),
  2073. 128
  2074. /* KEYED_FRAGMENT */
  2075. ))
  2076. ]),
  2077. vue.createElementVNode("picker-view-column", null, [
  2078. (vue.openBlock(true), vue.createElementBlock(
  2079. vue.Fragment,
  2080. null,
  2081. vue.renderList(_ctx.months, (item, index) => {
  2082. return vue.openBlock(), vue.createElementBlock(
  2083. "view",
  2084. {
  2085. class: "picker-item",
  2086. key: index
  2087. },
  2088. vue.toDisplayString(item) + "月",
  2089. 1
  2090. /* TEXT */
  2091. );
  2092. }),
  2093. 128
  2094. /* KEYED_FRAGMENT */
  2095. ))
  2096. ]),
  2097. vue.createElementVNode("picker-view-column", null, [
  2098. (vue.openBlock(true), vue.createElementBlock(
  2099. vue.Fragment,
  2100. null,
  2101. vue.renderList(_ctx.days, (item, index) => {
  2102. return vue.openBlock(), vue.createElementBlock(
  2103. "view",
  2104. {
  2105. class: "picker-item",
  2106. key: index
  2107. },
  2108. vue.toDisplayString(item) + "日",
  2109. 1
  2110. /* TEXT */
  2111. );
  2112. }),
  2113. 128
  2114. /* KEYED_FRAGMENT */
  2115. ))
  2116. ])
  2117. ], 40, ["value"])
  2118. ])
  2119. ],
  2120. 2
  2121. /* CLASS */
  2122. )
  2123. ]);
  2124. }
  2125. const PagesRecruitAuth = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/recruit/auth.vue"]]);
  2126. const logic$5 = {
  2127. data() {
  2128. return {
  2129. serviceTypes: [],
  2130. // 从上一页传递过来的服务类型列表
  2131. qualifications: {},
  2132. // 存储本地预览路径 { '宠物接送': ['path1', ...], ... }
  2133. qualOssIds: {}
  2134. // 存储OSS ID { '宠物接送': ['id1', ...], ... }
  2135. };
  2136. },
  2137. onLoad(options) {
  2138. if (options.services) {
  2139. try {
  2140. this.serviceTypes = JSON.parse(decodeURIComponent(options.services));
  2141. this.serviceTypes.forEach((item) => {
  2142. this.qualifications[item.name] = this.qualifications[item.name] || [];
  2143. this.qualOssIds[item.name] = this.qualOssIds[item.name] || [];
  2144. });
  2145. } catch (e) {
  2146. formatAppLog("error", "at pages/recruit/qualifications_logic.js:21", "Parse services failed", e);
  2147. }
  2148. }
  2149. this.restoreQualData();
  2150. },
  2151. methods: {
  2152. saveQualData() {
  2153. try {
  2154. uni.setStorageSync("recruit_qual_data", JSON.stringify({
  2155. qualifications: this.qualifications,
  2156. qualOssIds: this.qualOssIds
  2157. }));
  2158. } catch (e) {
  2159. formatAppLog("error", "at pages/recruit/qualifications_logic.js:35", "保存资质数据失败", e);
  2160. }
  2161. },
  2162. restoreQualData() {
  2163. try {
  2164. const saved = uni.getStorageSync("recruit_qual_data");
  2165. if (saved) {
  2166. const d = JSON.parse(saved);
  2167. this.qualifications = d.qualifications || {};
  2168. this.qualOssIds = d.qualOssIds || {};
  2169. this.$forceUpdate();
  2170. }
  2171. } catch (e) {
  2172. formatAppLog("error", "at pages/recruit/qualifications_logic.js:48", "恢复资质数据失败", e);
  2173. }
  2174. },
  2175. chooseImage(serviceName) {
  2176. uni.chooseImage({
  2177. count: 9,
  2178. sizeType: ["compressed"],
  2179. sourceType: ["album", "camera"],
  2180. success: async (res) => {
  2181. if (!this.qualifications[serviceName]) {
  2182. this.qualifications[serviceName] = [];
  2183. this.qualOssIds[serviceName] = [];
  2184. }
  2185. for (const tempPath of res.tempFilePaths) {
  2186. this.qualifications[serviceName].push(tempPath);
  2187. this.$forceUpdate();
  2188. try {
  2189. const uploadRes = await uploadFile(tempPath);
  2190. this.qualOssIds[serviceName].push(uploadRes.data.ossId);
  2191. this.saveQualData();
  2192. } catch (err) {
  2193. formatAppLog("error", "at pages/recruit/qualifications_logic.js:70", "上传资质图片失败:", err);
  2194. }
  2195. }
  2196. }
  2197. });
  2198. },
  2199. deleteImage(serviceName, index) {
  2200. this.qualifications[serviceName].splice(index, 1);
  2201. if (this.qualOssIds[serviceName]) {
  2202. this.qualOssIds[serviceName].splice(index, 1);
  2203. }
  2204. this.saveQualData();
  2205. this.$forceUpdate();
  2206. },
  2207. goBackToForm() {
  2208. const pages = getCurrentPages();
  2209. if (pages.length > 2) {
  2210. uni.navigateBack({
  2211. delta: 2
  2212. });
  2213. } else {
  2214. uni.reLaunch({
  2215. url: "/pages/recruit/form"
  2216. });
  2217. }
  2218. },
  2219. async submit() {
  2220. let recruitData = {};
  2221. try {
  2222. const stored = uni.getStorageSync("recruit_form_data");
  2223. if (stored) {
  2224. recruitData = JSON.parse(stored);
  2225. }
  2226. } catch (e) {
  2227. formatAppLog("error", "at pages/recruit/qualifications_logic.js:107", "读取招募表单数据失败", e);
  2228. }
  2229. const allQualOssIds = [];
  2230. Object.values(this.qualOssIds).forEach((ids) => {
  2231. allQualOssIds.push(...ids);
  2232. });
  2233. const auditData = {
  2234. name: recruitData.name || "",
  2235. phone: recruitData.mobile || "",
  2236. password: recruitData.password || "",
  2237. gender: recruitData.gender === 1 ? "0" : "1",
  2238. birthday: recruitData.birthday || "",
  2239. serviceTypes: (recruitData.serviceType || []).join(","),
  2240. // 逗号分隔的服务类型ID
  2241. city: recruitData.areaPath || "",
  2242. stationId: recruitData.stationId || null,
  2243. realName: recruitData.realName || "",
  2244. idCard: recruitData.idNumber || "",
  2245. idValidDate: recruitData.expiryDate || "",
  2246. idCardFront: recruitData.idCardFrontOssId || null,
  2247. idCardBack: recruitData.idCardBackOssId || null,
  2248. qualifications: allQualOssIds.join(",")
  2249. // 逗号分隔的资质图片OSS ID
  2250. };
  2251. uni.showLoading({ title: "提交中..." });
  2252. try {
  2253. await submitAudit(auditData);
  2254. uni.hideLoading();
  2255. const s = encodeURIComponent(recruitData.station || "");
  2256. const n = encodeURIComponent(recruitData.name || "");
  2257. const p = recruitData.mobile || "";
  2258. uni.removeStorageSync("recruit_form_data");
  2259. uni.removeStorageSync("recruit_auth_data");
  2260. uni.removeStorageSync("recruit_qual_data");
  2261. uni.reLaunch({
  2262. url: `/pages/recruit/success?station=${s}&name=${n}&phone=${p}`
  2263. });
  2264. } catch (err) {
  2265. uni.hideLoading();
  2266. formatAppLog("error", "at pages/recruit/qualifications_logic.js:153", "提交申请失败:", err);
  2267. }
  2268. }
  2269. }
  2270. };
  2271. const _sfc_main$z = logic$5;
  2272. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  2273. return vue.openBlock(), vue.createElementBlock("view", { class: "qual-container" }, [
  2274. vue.createElementVNode("view", { class: "top-tip" }, "根据国家政策要求,请尽快完成实名认证与健康认证,否则无法开展配送业务。我们承诺将严格保管好您的个人信息。"),
  2275. _ctx.serviceTypes.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  2276. key: 0,
  2277. class: "empty-state"
  2278. }, [
  2279. vue.createElementVNode("text", { class: "empty-tip" }, "请返回第一步选择服务类型"),
  2280. vue.createElementVNode("button", {
  2281. class: "back-btn",
  2282. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.goBackToForm && _ctx.goBackToForm(...args))
  2283. }, "返回选择")
  2284. ])) : vue.createCommentVNode("v-if", true),
  2285. (vue.openBlock(true), vue.createElementBlock(
  2286. vue.Fragment,
  2287. null,
  2288. vue.renderList(_ctx.serviceTypes, (item, index) => {
  2289. return vue.openBlock(), vue.createElementBlock("view", {
  2290. class: "qual-card",
  2291. key: item.id
  2292. }, [
  2293. vue.createElementVNode(
  2294. "view",
  2295. { class: "card-title" },
  2296. vue.toDisplayString(item.name) + "服务资质",
  2297. 1
  2298. /* TEXT */
  2299. ),
  2300. vue.createElementVNode("view", { class: "upload-wrapper" }, [
  2301. (vue.openBlock(true), vue.createElementBlock(
  2302. vue.Fragment,
  2303. null,
  2304. vue.renderList(_ctx.qualifications[item.name], (img, imgIndex) => {
  2305. return vue.openBlock(), vue.createElementBlock("view", {
  2306. class: "img-item",
  2307. key: imgIndex
  2308. }, [
  2309. vue.createElementVNode("image", {
  2310. src: img,
  2311. class: "preview-img",
  2312. mode: "aspectFill",
  2313. onClick: ($event) => _ctx.previewImage(item.name, imgIndex)
  2314. }, null, 8, ["src", "onClick"]),
  2315. vue.createElementVNode("view", {
  2316. class: "delete-btn",
  2317. onClick: vue.withModifiers(($event) => _ctx.deleteImage(item.name, imgIndex), ["stop"])
  2318. }, "×", 8, ["onClick"])
  2319. ]);
  2320. }),
  2321. 128
  2322. /* KEYED_FRAGMENT */
  2323. )),
  2324. vue.createElementVNode("view", {
  2325. class: "upload-box",
  2326. onClick: ($event) => _ctx.chooseImage(item.name)
  2327. }, [
  2328. vue.createElementVNode("text", { class: "plus-icon" }, "+"),
  2329. vue.createElementVNode("text", { class: "upload-text" }, "上传")
  2330. ], 8, ["onClick"])
  2331. ])
  2332. ]);
  2333. }),
  2334. 128
  2335. /* KEYED_FRAGMENT */
  2336. )),
  2337. vue.createElementVNode("view", { class: "footer-actions" }, [
  2338. vue.createElementVNode("button", {
  2339. class: "submit-btn",
  2340. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.submit && _ctx.submit(...args))
  2341. }, "立即提交")
  2342. ])
  2343. ]);
  2344. }
  2345. const PagesRecruitQualifications = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/recruit/qualifications.vue"]]);
  2346. const logic$4 = {
  2347. data() {
  2348. return {
  2349. station: "",
  2350. name: "",
  2351. phone: ""
  2352. };
  2353. },
  2354. onLoad(options) {
  2355. if (options.station) {
  2356. this.station = decodeURIComponent(options.station);
  2357. }
  2358. if (options.name) {
  2359. this.name = decodeURIComponent(options.name);
  2360. }
  2361. if (options.phone) {
  2362. this.phone = options.phone;
  2363. }
  2364. },
  2365. methods: {
  2366. goHome() {
  2367. uni.reLaunch({
  2368. url: "/pages/login/login"
  2369. });
  2370. }
  2371. }
  2372. };
  2373. const _sfc_main$y = logic$4;
  2374. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  2375. return vue.openBlock(), vue.createElementBlock("view", { class: "success-container" }, [
  2376. vue.createElementVNode("view", { class: "icon-area" }, [
  2377. (vue.openBlock(), vue.createElementBlock("svg", {
  2378. class: "success-icon",
  2379. viewBox: "0 0 1024 1024",
  2380. version: "1.1",
  2381. xmlns: "http://www.w3.org/2000/svg"
  2382. }, [
  2383. vue.createElementVNode("path", {
  2384. d: "M512 0C229.23 0 0 229.23 0 512s229.23 512 512 512 512-229.23 512-512S794.77 0 512 0z m0 960C264.58 960 64 759.42 64 512S264.58 64 512 64s448 200.58 448 448-200.58 448-448 448z",
  2385. fill: "#64D01D"
  2386. }),
  2387. vue.createElementVNode("path", {
  2388. d: "M743.08 335.78c-12.23-12.24-32.07-12.24-44.3 0L426.6 607.96 325.22 506.58c-12.24-12.24-32.07-12.24-44.3 0-12.24 12.24-12.24 32.07 0 44.3l124.58 124.58c6.12 6.12 14.14 9.17 22.15 9.17s16.03-3.05 22.15-9.17L743.08 380.08c12.24-12.24 12.24-32.07 0-44.3z",
  2389. fill: "#64D01D"
  2390. })
  2391. ])),
  2392. vue.createElementVNode("text", { class: "main-title" }, "提交成功")
  2393. ]),
  2394. vue.createElementVNode("text", { class: "sub-tip" }, "请保持手机畅通,等待平台工作人员与您联系"),
  2395. vue.createElementVNode("view", { class: "info-card" }, [
  2396. vue.createElementVNode("view", { class: "info-item" }, [
  2397. vue.createElementVNode("text", { class: "label" }, "服务站点:"),
  2398. vue.createElementVNode(
  2399. "text",
  2400. { class: "value" },
  2401. vue.toDisplayString(_ctx.station),
  2402. 1
  2403. /* TEXT */
  2404. )
  2405. ]),
  2406. vue.createElementVNode("view", { class: "info-item" }, [
  2407. vue.createElementVNode("text", { class: "label" }, "报 名 人 :"),
  2408. vue.createElementVNode(
  2409. "text",
  2410. { class: "value" },
  2411. vue.toDisplayString(_ctx.name),
  2412. 1
  2413. /* TEXT */
  2414. )
  2415. ]),
  2416. vue.createElementVNode("view", { class: "info-item" }, [
  2417. vue.createElementVNode("text", { class: "label" }, "联系手机:"),
  2418. vue.createElementVNode(
  2419. "text",
  2420. { class: "value" },
  2421. vue.toDisplayString(_ctx.phone),
  2422. 1
  2423. /* TEXT */
  2424. )
  2425. ])
  2426. ]),
  2427. vue.createElementVNode("view", {
  2428. class: "footer-btn",
  2429. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.goHome && _ctx.goHome(...args))
  2430. }, "我知道了")
  2431. ]);
  2432. }
  2433. const PagesRecruitSuccess = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/recruit/success.vue"]]);
  2434. const _sfc_main$x = {
  2435. data() {
  2436. return {
  2437. mobile: "",
  2438. code: "",
  2439. countDown: 0,
  2440. timer: null
  2441. };
  2442. },
  2443. computed: {
  2444. mobileMask() {
  2445. if (!this.mobile)
  2446. return "";
  2447. return this.mobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
  2448. }
  2449. },
  2450. onLoad(options) {
  2451. if (options.mobile) {
  2452. this.mobile = options.mobile;
  2453. } else {
  2454. this.mobile = "13412346783";
  2455. }
  2456. },
  2457. methods: {
  2458. getVerifyCode() {
  2459. if (this.countDown > 0)
  2460. return;
  2461. this.countDown = 60;
  2462. this.timer = setInterval(() => {
  2463. this.countDown--;
  2464. if (this.countDown <= 0) {
  2465. clearInterval(this.timer);
  2466. }
  2467. }, 1e3);
  2468. uni.showToast({ title: "验证码已发送", icon: "none" });
  2469. },
  2470. nextStep() {
  2471. if (!this.code) {
  2472. uni.showToast({ title: "请输入验证码", icon: "none" });
  2473. return;
  2474. }
  2475. uni.navigateTo({
  2476. url: "/pages/login/reset-pwd-set"
  2477. });
  2478. }
  2479. }
  2480. };
  2481. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  2482. return vue.openBlock(), vue.createElementBlock("view", { class: "reset-container" }, [
  2483. vue.createElementVNode("view", { class: "content" }, [
  2484. vue.createElementVNode(
  2485. "view",
  2486. { class: "tip-text" },
  2487. "请输入 +86 " + vue.toDisplayString($options.mobileMask) + " 收到的短信验证码,进行验证~",
  2488. 1
  2489. /* TEXT */
  2490. ),
  2491. vue.createElementVNode("view", { class: "input-group" }, [
  2492. vue.createElementVNode("text", { class: "label" }, "验证码"),
  2493. vue.createElementVNode("view", { class: "input-wrapper" }, [
  2494. vue.withDirectives(vue.createElementVNode(
  2495. "input",
  2496. {
  2497. class: "code-input",
  2498. type: "number",
  2499. maxlength: "6",
  2500. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.code = $event)
  2501. },
  2502. null,
  2503. 512
  2504. /* NEED_PATCH */
  2505. ), [
  2506. [vue.vModelText, $data.code]
  2507. ]),
  2508. vue.createElementVNode("view", {
  2509. class: "get-code-btn",
  2510. onClick: _cache[1] || (_cache[1] = (...args) => $options.getVerifyCode && $options.getVerifyCode(...args))
  2511. }, [
  2512. vue.createElementVNode(
  2513. "text",
  2514. { class: "btn-text" },
  2515. vue.toDisplayString($data.countDown > 0 ? `${$data.countDown}s` : "获取验证码"),
  2516. 1
  2517. /* TEXT */
  2518. )
  2519. ])
  2520. ])
  2521. ]),
  2522. vue.createElementVNode("button", {
  2523. class: "next-btn",
  2524. onClick: _cache[2] || (_cache[2] = (...args) => $options.nextStep && $options.nextStep(...args))
  2525. }, "下一步")
  2526. ])
  2527. ]);
  2528. }
  2529. const PagesLoginResetPwdVerify = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/login/reset-pwd-verify.vue"]]);
  2530. const _sfc_main$w = {
  2531. data() {
  2532. return {
  2533. pwd1: "",
  2534. pwd2: ""
  2535. };
  2536. },
  2537. methods: {
  2538. confirmReset() {
  2539. if (!this.pwd1 || !this.pwd2) {
  2540. uni.showToast({ title: "请输入密码", icon: "none" });
  2541. return;
  2542. }
  2543. if (this.pwd1 !== this.pwd2) {
  2544. uni.showToast({ title: "两次密码不一致", icon: "none" });
  2545. return;
  2546. }
  2547. uni.showToast({ title: "重置成功", icon: "success" });
  2548. setTimeout(() => {
  2549. uni.navigateBack({
  2550. delta: 2
  2551. // 返回到登录页
  2552. });
  2553. }, 1500);
  2554. }
  2555. }
  2556. };
  2557. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  2558. return vue.openBlock(), vue.createElementBlock("view", { class: "reset-container" }, [
  2559. vue.createElementVNode("view", { class: "content" }, [
  2560. vue.createElementVNode("view", { class: "tip-text" }, "请输入新密码,并重新登录验证"),
  2561. vue.createElementVNode("view", { class: "input-form" }, [
  2562. vue.createElementVNode("view", { class: "input-row" }, [
  2563. vue.withDirectives(vue.createElementVNode(
  2564. "input",
  2565. {
  2566. class: "pwd-input",
  2567. type: "text",
  2568. password: "",
  2569. placeholder: "限12-20位字母和数字组合",
  2570. "placeholder-style": "color:#ccc",
  2571. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.pwd1 = $event)
  2572. },
  2573. null,
  2574. 512
  2575. /* NEED_PATCH */
  2576. ), [
  2577. [vue.vModelText, $data.pwd1]
  2578. ])
  2579. ]),
  2580. vue.createElementVNode("view", { class: "divider" }),
  2581. vue.createElementVNode("view", { class: "input-row" }, [
  2582. vue.withDirectives(vue.createElementVNode(
  2583. "input",
  2584. {
  2585. class: "pwd-input",
  2586. type: "text",
  2587. password: "",
  2588. placeholder: "限12-20位字母和数字组合",
  2589. "placeholder-style": "color:#ccc",
  2590. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.pwd2 = $event)
  2591. },
  2592. null,
  2593. 512
  2594. /* NEED_PATCH */
  2595. ), [
  2596. [vue.vModelText, $data.pwd2]
  2597. ])
  2598. ]),
  2599. vue.createElementVNode("view", { class: "divider" })
  2600. ]),
  2601. vue.createElementVNode("button", {
  2602. class: "confirm-btn",
  2603. onClick: _cache[2] || (_cache[2] = (...args) => $options.confirmReset && $options.confirmReset(...args))
  2604. }, "确定")
  2605. ])
  2606. ]);
  2607. }
  2608. const PagesLoginResetPwdSet = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/login/reset-pwd-set.vue"]]);
  2609. function cancelOrderApi(data) {
  2610. return request({
  2611. url: "/order/subOrder/cancel",
  2612. method: "PUT",
  2613. data
  2614. });
  2615. }
  2616. function rejectOrderApi(data) {
  2617. return request({
  2618. url: "/order/subOrder/reject",
  2619. method: "PUT",
  2620. data
  2621. });
  2622. }
  2623. function getPendingOrders(params) {
  2624. return request({
  2625. url: "/order/subOrder/listPendingAccept",
  2626. method: "GET",
  2627. data: params
  2628. });
  2629. }
  2630. function acceptOrder(orderId) {
  2631. return request({
  2632. url: "/order/subOrder/accept",
  2633. method: "PUT",
  2634. data: { orderId }
  2635. });
  2636. }
  2637. function getOrderCount() {
  2638. return request({
  2639. url: "/order/subOrder/count",
  2640. method: "GET"
  2641. });
  2642. }
  2643. function getStatisticOrders(params) {
  2644. return request({
  2645. url: "/order/subOrder/listOnStatistic",
  2646. method: "GET",
  2647. data: params
  2648. });
  2649. }
  2650. function getMyOrders(params) {
  2651. return request({
  2652. url: "/order/subOrder/listOnMyOrder",
  2653. method: "GET",
  2654. data: params
  2655. });
  2656. }
  2657. function getOrderInfo(id) {
  2658. return request({
  2659. url: `/order/subOrder/getInfo?id=${id}`,
  2660. method: "GET"
  2661. });
  2662. }
  2663. function clockIn(data) {
  2664. return request({
  2665. url: "/order/subOrder/clockIn",
  2666. method: "PUT",
  2667. data
  2668. });
  2669. }
  2670. function submitNursingSummary(data) {
  2671. return request({
  2672. url: "/order/subOrder/nursingSummary",
  2673. method: "PUT",
  2674. data
  2675. });
  2676. }
  2677. const _sfc_main$v = {
  2678. __name: "index",
  2679. props: {
  2680. currentPath: {
  2681. type: String,
  2682. required: true
  2683. }
  2684. },
  2685. setup(__props, { expose: __expose }) {
  2686. __expose();
  2687. const props = __props;
  2688. const list = vue.ref([
  2689. {
  2690. pagePath: "pages/home/index",
  2691. text: "任务中心",
  2692. iconPath: "/static/tabbar/home.svg",
  2693. selectedIconPath: "/static/tabbar/home-active.svg"
  2694. },
  2695. {
  2696. pagePath: "pages/orders/index",
  2697. text: "我的订单",
  2698. iconPath: "/static/tabbar/order.svg",
  2699. selectedIconPath: "/static/tabbar/order-active.svg"
  2700. },
  2701. {
  2702. pagePath: "pages/mine/index",
  2703. text: "我的",
  2704. iconPath: "/static/tabbar/mine.svg",
  2705. selectedIconPath: "/static/tabbar/mine-active.svg"
  2706. }
  2707. ]);
  2708. const switchTab = (path) => {
  2709. if (props.currentPath === path)
  2710. return;
  2711. uni.switchTab({
  2712. url: "/" + path
  2713. });
  2714. };
  2715. const __returned__ = { props, list, switchTab, ref: vue.ref };
  2716. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  2717. return __returned__;
  2718. }
  2719. };
  2720. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  2721. return vue.openBlock(), vue.createElementBlock("view", { class: "custom-tabbar" }, [
  2722. vue.createElementVNode("view", { class: "tabbar-border" }),
  2723. vue.createElementVNode("view", { class: "tabbar-list" }, [
  2724. (vue.openBlock(true), vue.createElementBlock(
  2725. vue.Fragment,
  2726. null,
  2727. vue.renderList($setup.list, (item, index) => {
  2728. return vue.openBlock(), vue.createElementBlock("view", {
  2729. class: "tabbar-item",
  2730. key: index,
  2731. onClick: ($event) => $setup.switchTab(item.pagePath)
  2732. }, [
  2733. vue.createElementVNode("image", {
  2734. class: "tabbar-icon",
  2735. src: $props.currentPath === item.pagePath ? item.selectedIconPath : item.iconPath
  2736. }, null, 8, ["src"]),
  2737. vue.createElementVNode(
  2738. "view",
  2739. {
  2740. class: vue.normalizeClass(["tabbar-text", { "tabbar-text-active": $props.currentPath === item.pagePath }])
  2741. },
  2742. vue.toDisplayString(item.text),
  2743. 3
  2744. /* TEXT, CLASS */
  2745. )
  2746. ], 8, ["onClick"]);
  2747. }),
  2748. 128
  2749. /* KEYED_FRAGMENT */
  2750. ))
  2751. ])
  2752. ]);
  2753. }
  2754. const customTabbar = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-52454e90"], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/components/custom-tabbar/index.vue"]]);
  2755. const logic$3 = {
  2756. components: {
  2757. customTabbar
  2758. },
  2759. data() {
  2760. return {
  2761. taskList: [],
  2762. currentFilter: "default",
  2763. // default, distance, time
  2764. filterCondition: "筛选条件",
  2765. sortDistance: "asc",
  2766. // asc, desc
  2767. sortTime: "asc",
  2768. scrollTop: 0,
  2769. // Track scroll position
  2770. isFilterShow: false,
  2771. tempFilter: {
  2772. service: null,
  2773. distance: "全部",
  2774. amount: "全部"
  2775. },
  2776. activeFilter: {
  2777. service: null,
  2778. distance: "全部",
  2779. amount: "全部"
  2780. },
  2781. workStatus: "resting",
  2782. // resting | busy | disabled
  2783. showConfirmModal: false,
  2784. showPetModal: false,
  2785. currentPetInfo: {},
  2786. showRejectModal: false,
  2787. rejectReason: "",
  2788. currentOrder: null,
  2789. showAcceptConfirmModal: false,
  2790. showNavModal: false,
  2791. navTargetItem: null,
  2792. navTargetPointType: "",
  2793. profile: null,
  2794. profileLoading: false,
  2795. serviceList: [],
  2796. orderStats: {
  2797. total: 0,
  2798. reject: 0,
  2799. completed: 0,
  2800. price: 0
  2801. }
  2802. };
  2803. },
  2804. onPageScroll(e) {
  2805. this.scrollTop = e.scrollTop;
  2806. },
  2807. async onLoad() {
  2808. this.checkWorkStatus();
  2809. await this.loadServiceList();
  2810. this.loadTaskList();
  2811. reportGps(true).catch((e) => formatAppLog("log", "at pages/home/logic.js:64", "Init GPS check skipped", e));
  2812. },
  2813. onShow() {
  2814. uni.hideTabBar();
  2815. this.checkWorkStatus();
  2816. if (isLoggedIn()) {
  2817. this.loadProfile();
  2818. this.loadOrderStats();
  2819. this.loadTaskList();
  2820. this.loadServiceList();
  2821. }
  2822. },
  2823. async onPullDownRefresh() {
  2824. this.checkWorkStatus();
  2825. try {
  2826. await this.loadServiceList();
  2827. const tasks = [
  2828. this.loadTaskList()
  2829. ];
  2830. if (isLoggedIn()) {
  2831. tasks.push(this.loadProfile());
  2832. tasks.push(this.loadOrderStats());
  2833. }
  2834. await Promise.all(tasks);
  2835. } catch (err) {
  2836. formatAppLog("error", "at pages/home/logic.js:94", "刷新异常:", err);
  2837. } finally {
  2838. uni.stopPullDownRefresh();
  2839. uni.showToast({ title: "刷新成功", icon: "success" });
  2840. }
  2841. },
  2842. methods: {
  2843. async loadProfile() {
  2844. if (this.profileLoading)
  2845. return;
  2846. this.profileLoading = true;
  2847. try {
  2848. const res = await getMyProfile();
  2849. const data = res.data || null;
  2850. if (data) {
  2851. if (data.status) {
  2852. this.workStatus = data.status;
  2853. uni.setStorageSync("workStatus", data.status);
  2854. }
  2855. if (data.stationId) {
  2856. try {
  2857. const stationRes = await getAreaStationList();
  2858. const list = stationRes.data || [];
  2859. const currentStation = list.find((i) => i.id === data.stationId);
  2860. if (currentStation) {
  2861. let node = currentStation;
  2862. while (node && node.parentId !== 0) {
  2863. let parent = list.find((i) => i.id === node.parentId);
  2864. if (parent) {
  2865. node = parent;
  2866. } else {
  2867. break;
  2868. }
  2869. }
  2870. data.cityName = node.name;
  2871. }
  2872. } catch (e) {
  2873. formatAppLog("error", "at pages/home/logic.js:136", "溯源城市失败:", e);
  2874. }
  2875. }
  2876. }
  2877. this.profile = data;
  2878. } catch (err) {
  2879. formatAppLog("error", "at pages/home/logic.js:143", "获取个人信息失败:", err);
  2880. } finally {
  2881. this.profileLoading = false;
  2882. }
  2883. },
  2884. async loadServiceList() {
  2885. try {
  2886. const res = await listAllService();
  2887. this.serviceList = res.data || [];
  2888. } catch (err) {
  2889. formatAppLog("error", "at pages/home/logic.js:153", "获取服务类型失败:", err);
  2890. }
  2891. },
  2892. async loadOrderStats() {
  2893. try {
  2894. const res = await getOrderCount();
  2895. this.orderStats = res.data || { total: 0, reject: 0, completed: 0, price: 0 };
  2896. } catch (err) {
  2897. formatAppLog("error", "at pages/home/logic.js:161", "获取订单统计失败:", err);
  2898. }
  2899. },
  2900. checkWorkStatus() {
  2901. const status = uni.getStorageSync("workStatus");
  2902. if (status) {
  2903. this.workStatus = status;
  2904. } else {
  2905. this.workStatus = "resting";
  2906. uni.setStorageSync("workStatus", "resting");
  2907. }
  2908. },
  2909. toggleFilter() {
  2910. if (this.workStatus === "resting")
  2911. return;
  2912. this.isFilterShow = !this.isFilterShow;
  2913. },
  2914. goToWorkStatus() {
  2915. uni.navigateTo({
  2916. url: "/pages/home/work-status"
  2917. });
  2918. },
  2919. async handleManualLocation() {
  2920. try {
  2921. uni.showLoading({ title: "定位获取中...", mask: true });
  2922. await reportGps(true);
  2923. uni.showToast({ title: "位置已更新", icon: "success" });
  2924. } catch (e) {
  2925. formatAppLog("error", "at pages/home/logic.js:189", "Manual location failed", e);
  2926. } finally {
  2927. uni.hideLoading();
  2928. }
  2929. },
  2930. startWork() {
  2931. this.showConfirmModal = true;
  2932. },
  2933. confirmStartWork() {
  2934. this.workStatus = "busy";
  2935. uni.setStorageSync("workStatus", "busy");
  2936. this.loadTaskList();
  2937. this.showConfirmModal = false;
  2938. uni.showToast({ title: "已开始接单", icon: "success" });
  2939. },
  2940. closeConfirmModal() {
  2941. this.showConfirmModal = false;
  2942. },
  2943. showPetProfile(item) {
  2944. this.currentPetInfo = item;
  2945. this.showPetModal = true;
  2946. },
  2947. closePetProfile() {
  2948. this.showPetModal = false;
  2949. },
  2950. openRejectModal(item) {
  2951. this.currentOrder = item;
  2952. this.rejectReason = "";
  2953. this.showRejectModal = true;
  2954. },
  2955. closeRejectModal() {
  2956. this.showRejectModal = false;
  2957. this.currentOrder = null;
  2958. },
  2959. async confirmReject() {
  2960. var _a;
  2961. if (!this.rejectReason.trim()) {
  2962. uni.showToast({ title: "请输入拒绝理由", icon: "none" });
  2963. return;
  2964. }
  2965. if (!((_a = this.currentOrder) == null ? void 0 : _a.id))
  2966. return;
  2967. try {
  2968. uni.showLoading({ title: "提交中...", mask: true });
  2969. await rejectOrderApi({
  2970. orderId: this.currentOrder.id,
  2971. rejectReason: this.rejectReason
  2972. });
  2973. uni.showToast({ title: "已拒绝接单", icon: "success" });
  2974. this.showRejectModal = false;
  2975. this.currentOrder = null;
  2976. this.loadTaskList();
  2977. this.loadOrderStats();
  2978. } catch (err) {
  2979. formatAppLog("error", "at pages/home/logic.js:241", "拒绝接单失败:", err);
  2980. uni.showToast({ title: "操作失败", icon: "none" });
  2981. } finally {
  2982. uni.hideLoading();
  2983. }
  2984. },
  2985. openAcceptModal(item) {
  2986. this.currentOrder = item;
  2987. this.showAcceptConfirmModal = true;
  2988. },
  2989. closeAcceptModal() {
  2990. this.showAcceptConfirmModal = false;
  2991. this.currentOrder = null;
  2992. },
  2993. async confirmAccept() {
  2994. var _a;
  2995. if (!((_a = this.currentOrder) == null ? void 0 : _a.id))
  2996. return;
  2997. try {
  2998. await acceptOrder(this.currentOrder.id);
  2999. uni.showToast({ title: "接单成功", icon: "success" });
  3000. this.showAcceptConfirmModal = false;
  3001. this.currentOrder = null;
  3002. this.loadTaskList();
  3003. this.loadProfile();
  3004. this.loadOrderStats();
  3005. } catch (err) {
  3006. formatAppLog("error", "at pages/home/logic.js:266", "接单失败:", err);
  3007. uni.showToast({ title: "接单失败", icon: "none" });
  3008. }
  3009. },
  3010. openNavigation(item, pointType) {
  3011. this.navTargetItem = item;
  3012. this.navTargetPointType = pointType;
  3013. this.showNavModal = true;
  3014. },
  3015. closeNavModal() {
  3016. this.showNavModal = false;
  3017. },
  3018. chooseMap(mapType) {
  3019. let item = this.navTargetItem;
  3020. let pointType = this.navTargetPointType;
  3021. let name = pointType === "start" ? item.fromAddress || "起点" : item.toAddress || "终点";
  3022. let address = pointType === "start" ? item.fromAddress || "起点地址" : item.toAddress || "终点地址";
  3023. let latitude = pointType === "start" ? Number(item.fromLat) : Number(item.toLat);
  3024. let longitude = pointType === "start" ? Number(item.fromLng) : Number(item.toLng);
  3025. this.showNavModal = false;
  3026. const navigateTo = (lat, lng, addrName, addrDesc) => {
  3027. uni.openLocation({
  3028. latitude: lat,
  3029. longitude: lng,
  3030. name: addrName,
  3031. address: addrDesc || "无法获取详细地址",
  3032. success: function() {
  3033. formatAppLog("log", "at pages/home/logic.js:297", "打开导航成功: " + mapType);
  3034. },
  3035. fail: function(err) {
  3036. formatAppLog("error", "at pages/home/logic.js:300", "打开导航失败:", err);
  3037. uni.showToast({ title: "打开地图失败", icon: "none" });
  3038. }
  3039. });
  3040. };
  3041. if (latitude && longitude && !isNaN(latitude) && !isNaN(longitude)) {
  3042. navigateTo(latitude, longitude, name, address);
  3043. } else {
  3044. uni.showLoading({ title: "获取当前位置...", mask: true });
  3045. uni.getLocation({
  3046. type: "gcj02",
  3047. success: (res) => {
  3048. uni.hideLoading();
  3049. navigateTo(res.latitude, res.longitude, name, address);
  3050. },
  3051. fail: (err) => {
  3052. uni.hideLoading();
  3053. formatAppLog("error", "at pages/home/logic.js:321", "获取地理位置失败:", err);
  3054. uni.showToast({ title: "无法获取当前位置信息", icon: "none" });
  3055. }
  3056. });
  3057. }
  3058. },
  3059. selectService(type) {
  3060. this.tempFilter.service = type;
  3061. },
  3062. selectDistance(type) {
  3063. this.tempFilter.distance = type;
  3064. },
  3065. selectAmount(type) {
  3066. this.tempFilter.amount = type;
  3067. },
  3068. resetFilter() {
  3069. this.tempFilter = {
  3070. service: null,
  3071. distance: "全部",
  3072. amount: "全部"
  3073. };
  3074. },
  3075. confirmFilter() {
  3076. this.activeFilter = { ...this.tempFilter };
  3077. this.isFilterShow = false;
  3078. this.loadTaskList();
  3079. },
  3080. closeFilter() {
  3081. this.isFilterShow = false;
  3082. },
  3083. goToDetail(item) {
  3084. formatAppLog("log", "at pages/home/logic.js:352", "Go to detail", item);
  3085. },
  3086. async loadTaskList() {
  3087. try {
  3088. const params = {
  3089. service: this.activeFilter.service,
  3090. minPrice: this.getMinPrice(),
  3091. maxPrice: this.getMaxPrice(),
  3092. pageNum: 1,
  3093. pageSize: 20
  3094. };
  3095. const res = await getPendingOrders(params);
  3096. this.taskList = (res.rows || []).map((item) => this.transformOrder(item));
  3097. } catch (err) {
  3098. formatAppLog("error", "at pages/home/logic.js:366", "获取订单列表失败:", err);
  3099. uni.showToast({ title: "加载失败", icon: "none" });
  3100. this.taskList = [];
  3101. }
  3102. },
  3103. getMinPrice() {
  3104. const amount = this.activeFilter.amount;
  3105. if (amount === "100以下")
  3106. return 0;
  3107. if (amount === "100-200")
  3108. return 1e4;
  3109. if (amount === "200-500")
  3110. return 2e4;
  3111. if (amount === "500以上")
  3112. return 5e4;
  3113. return void 0;
  3114. },
  3115. getMaxPrice() {
  3116. const amount = this.activeFilter.amount;
  3117. if (amount === "100以下")
  3118. return 1e4;
  3119. if (amount === "100-200")
  3120. return 2e4;
  3121. if (amount === "200-500")
  3122. return 5e4;
  3123. return void 0;
  3124. },
  3125. transformOrder(item) {
  3126. const service = this.serviceList.find((s) => s.id === item.service);
  3127. const serviceText = (service == null ? void 0 : service.name) || "未知";
  3128. const serviceIcon = (service == null ? void 0 : service.iconUrl) || "";
  3129. const mode = (service == null ? void 0 : service.mode) || 0;
  3130. const isRoundTrip = mode === 1;
  3131. return {
  3132. id: item.id,
  3133. type: isRoundTrip ? 1 : item.service,
  3134. typeText: serviceText,
  3135. typeIcon: serviceIcon,
  3136. price: (item.price / 100).toFixed(2),
  3137. timeLabel: "服务时间",
  3138. time: item.serviceTime,
  3139. petAvatar: item.petAvatar || "/static/dog.png",
  3140. petAvatarUrl: item.petAvatarUrl || "",
  3141. petName: item.petName,
  3142. petBreed: item.breed,
  3143. petGender: "M",
  3144. petAge: "",
  3145. petWeight: "",
  3146. petPersonality: "",
  3147. petHobby: "",
  3148. petRemark: "",
  3149. petTags: [],
  3150. petLogs: [],
  3151. startLocation: item.fromAddress || "暂无起点",
  3152. startAddress: item.fromAddress || "",
  3153. fromAddress: item.fromAddress || "",
  3154. fromLat: item.fromLat,
  3155. fromLng: item.fromLng,
  3156. startDistance: "0km",
  3157. endLocation: (item.customerName || item.contact || "") + " " + (item.customerPhone || ""),
  3158. endAddress: item.toAddress || "",
  3159. toAddress: item.toAddress || "",
  3160. toLat: item.toLat,
  3161. toLng: item.toLng,
  3162. endDistance: "0km",
  3163. serviceContent: "",
  3164. remark: item.remark || ""
  3165. };
  3166. },
  3167. setFilter(type) {
  3168. this.currentFilter = type;
  3169. if (type === "distance") {
  3170. this.sortDistance = this.sortDistance === "asc" ? "desc" : "asc";
  3171. uni.showToast({ title: `按距离${this.sortDistance === "asc" ? "升序" : "降序"}`, icon: "none" });
  3172. } else if (type === "time") {
  3173. this.sortTime = this.sortTime === "asc" ? "desc" : "asc";
  3174. uni.showToast({ title: `按时间${this.sortTime === "asc" ? "升序" : "降序"}`, icon: "none" });
  3175. }
  3176. },
  3177. showFilterDropdown() {
  3178. this.toggleFilter();
  3179. }
  3180. }
  3181. };
  3182. const _imports_3$2 = "/static/icons/nav_arrow.svg";
  3183. const _sfc_main$u = {
  3184. ...logic$3
  3185. };
  3186. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  3187. var _a, _b, _c;
  3188. const _component_custom_tabbar = vue.resolveComponent("custom-tabbar");
  3189. return vue.openBlock(), vue.createElementBlock(
  3190. vue.Fragment,
  3191. null,
  3192. [
  3193. vue.createElementVNode("view", { class: "container" }, [
  3194. vue.createElementVNode(
  3195. "view",
  3196. {
  3197. class: "custom-nav-bar",
  3198. style: vue.normalizeStyle({ backgroundColor: _ctx.scrollTop > 20 ? "#fff" : "transparent" })
  3199. },
  3200. [
  3201. vue.createElementVNode("text", { class: "nav-title" }, "任务中心")
  3202. ],
  3203. 4
  3204. /* STYLE */
  3205. ),
  3206. vue.createElementVNode("view", { class: "nav-bg" }, [
  3207. vue.createElementVNode("view", { class: "bg-circle-left" }),
  3208. vue.createElementVNode("view", { class: "bg-circle-right" })
  3209. ]),
  3210. vue.createElementVNode("view", { class: "header-section" }, [
  3211. vue.createElementVNode("view", { class: "user-info" }, [
  3212. vue.createElementVNode("image", {
  3213. class: "avatar",
  3214. src: ((_a = _ctx.profile) == null ? void 0 : _a.avatarUrl) || "/static/touxiang.png",
  3215. mode: "aspectFill"
  3216. }, null, 8, ["src"]),
  3217. vue.createElementVNode("view", { class: "info-content" }, [
  3218. vue.createElementVNode("view", { class: "top-row" }, [
  3219. vue.createElementVNode(
  3220. "text",
  3221. { class: "name" },
  3222. vue.toDisplayString(((_b = _ctx.profile) == null ? void 0 : _b.name) || "未登录"),
  3223. 1
  3224. /* TEXT */
  3225. ),
  3226. vue.createElementVNode(
  3227. "view",
  3228. {
  3229. class: vue.normalizeClass(["status-pill", { "resting": _ctx.workStatus !== "busy" }]),
  3230. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.goToWorkStatus && _ctx.goToWorkStatus(...args))
  3231. },
  3232. [
  3233. vue.createElementVNode(
  3234. "view",
  3235. {
  3236. class: vue.normalizeClass(["status-dot-bg", { "busy": _ctx.workStatus === "busy", "disabled": _ctx.workStatus === "disabled" }])
  3237. },
  3238. [
  3239. _ctx.workStatus === "busy" ? (vue.openBlock(), vue.createElementBlock("text", {
  3240. key: 0,
  3241. class: "check-mark"
  3242. }, "✔")) : (vue.openBlock(), vue.createElementBlock("text", {
  3243. key: 1,
  3244. class: "check-mark",
  3245. style: { "font-size": "16rpx", "line-height": "20rpx" }
  3246. }, "✕"))
  3247. ],
  3248. 2
  3249. /* CLASS */
  3250. ),
  3251. vue.createElementVNode(
  3252. "text",
  3253. { class: "status-text" },
  3254. vue.toDisplayString(_ctx.workStatus === "busy" ? "接单中" : _ctx.workStatus === "resting" ? "正在休息" : "已禁用"),
  3255. 1
  3256. /* TEXT */
  3257. ),
  3258. vue.createElementVNode("text", { class: "arrow-down" }, "▼")
  3259. ],
  3260. 2
  3261. /* CLASS */
  3262. )
  3263. ]),
  3264. vue.createElementVNode("view", {
  3265. class: "bottom-row",
  3266. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleManualLocation && _ctx.handleManualLocation(...args))
  3267. }, [
  3268. vue.createElementVNode(
  3269. "text",
  3270. { class: "city-label" },
  3271. "接单城市:" + vue.toDisplayString(((_c = _ctx.profile) == null ? void 0 : _c.cityName) || "暂无"),
  3272. 1
  3273. /* TEXT */
  3274. ),
  3275. vue.createElementVNode("text", { class: "city-arrow" }, ">")
  3276. ])
  3277. ])
  3278. ]),
  3279. vue.createElementVNode("view", { class: "stats-card" }, [
  3280. vue.createElementVNode("view", { class: "stat-item" }, [
  3281. vue.createElementVNode(
  3282. "text",
  3283. { class: "num" },
  3284. vue.toDisplayString(_ctx.orderStats.total),
  3285. 1
  3286. /* TEXT */
  3287. ),
  3288. vue.createElementVNode("text", { class: "label" }, "全部订单")
  3289. ]),
  3290. vue.createElementVNode("view", { class: "divider" }),
  3291. vue.createElementVNode("view", { class: "stat-item" }, [
  3292. vue.createElementVNode(
  3293. "text",
  3294. { class: "num" },
  3295. vue.toDisplayString(_ctx.orderStats.reject),
  3296. 1
  3297. /* TEXT */
  3298. ),
  3299. vue.createElementVNode("text", { class: "label" }, "拒接订单")
  3300. ]),
  3301. vue.createElementVNode("view", { class: "divider" }),
  3302. vue.createElementVNode("view", { class: "stat-item" }, [
  3303. vue.createElementVNode(
  3304. "text",
  3305. { class: "num" },
  3306. vue.toDisplayString(_ctx.orderStats.completed),
  3307. 1
  3308. /* TEXT */
  3309. ),
  3310. vue.createElementVNode("text", { class: "label" }, "完成订单")
  3311. ]),
  3312. vue.createElementVNode("view", { class: "divider" }),
  3313. vue.createElementVNode("view", { class: "stat-item" }, [
  3314. vue.createElementVNode(
  3315. "text",
  3316. { class: "num" },
  3317. vue.toDisplayString((_ctx.orderStats.price / 100).toFixed(2)),
  3318. 1
  3319. /* TEXT */
  3320. ),
  3321. vue.createElementVNode("text", { class: "label" }, "服务总得")
  3322. ])
  3323. ])
  3324. ]),
  3325. vue.createElementVNode("view", { class: "task-header" }, [
  3326. vue.createElementVNode(
  3327. "view",
  3328. {
  3329. class: "header-inner",
  3330. style: vue.normalizeStyle({ backgroundColor: _ctx.scrollTop > 300 || _ctx.isFilterShow ? "#fff" : "transparent" })
  3331. },
  3332. [
  3333. vue.createElementVNode("view", { class: "left-title" }, [
  3334. vue.createElementVNode("view", { class: "orange-bar" }),
  3335. vue.createElementVNode("text", { class: "title" }, "任务大厅"),
  3336. vue.createElementVNode(
  3337. "text",
  3338. { class: "count" },
  3339. "- (" + vue.toDisplayString(_ctx.taskList.length) + "单)",
  3340. 1
  3341. /* TEXT */
  3342. )
  3343. ]),
  3344. vue.createElementVNode("view", { class: "filter-options" }, [
  3345. vue.createElementVNode("view", {
  3346. class: "dropdown",
  3347. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.showFilterDropdown && _ctx.showFilterDropdown(...args))
  3348. }, [
  3349. vue.createElementVNode("text", null, "筛选条件"),
  3350. vue.createElementVNode("text", { class: "arrow-down" }, "﹀")
  3351. ])
  3352. ])
  3353. ],
  3354. 4
  3355. /* STYLE */
  3356. ),
  3357. _ctx.isFilterShow ? (vue.openBlock(), vue.createElementBlock("view", {
  3358. key: 0,
  3359. class: "filter-mask",
  3360. onClick: _cache[3] || (_cache[3] = (...args) => _ctx.closeFilter && _ctx.closeFilter(...args))
  3361. })) : vue.createCommentVNode("v-if", true),
  3362. vue.createElementVNode(
  3363. "view",
  3364. {
  3365. class: vue.normalizeClass(["filter-panel", { show: _ctx.isFilterShow }])
  3366. },
  3367. [
  3368. vue.createElementVNode("view", { class: "filter-section" }, [
  3369. vue.createElementVNode("text", { class: "section-title" }, "服务类型"),
  3370. vue.createElementVNode("view", { class: "options-grid" }, [
  3371. vue.createElementVNode(
  3372. "view",
  3373. {
  3374. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.service === null }]),
  3375. onClick: _cache[4] || (_cache[4] = ($event) => _ctx.selectService(null))
  3376. },
  3377. "全部",
  3378. 2
  3379. /* CLASS */
  3380. ),
  3381. (vue.openBlock(true), vue.createElementBlock(
  3382. vue.Fragment,
  3383. null,
  3384. vue.renderList(_ctx.serviceList, (item) => {
  3385. return vue.openBlock(), vue.createElementBlock("view", {
  3386. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.service === item.id }]),
  3387. key: item.id,
  3388. onClick: ($event) => _ctx.selectService(item.id)
  3389. }, vue.toDisplayString(item.name), 11, ["onClick"]);
  3390. }),
  3391. 128
  3392. /* KEYED_FRAGMENT */
  3393. ))
  3394. ])
  3395. ]),
  3396. vue.createElementVNode("view", { class: "filter-section" }, [
  3397. vue.createElementVNode("text", { class: "section-title" }, "金额"),
  3398. vue.createElementVNode("view", { class: "options-grid" }, [
  3399. vue.createElementVNode(
  3400. "view",
  3401. {
  3402. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.amount === "全部" }]),
  3403. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.selectAmount("全部"))
  3404. },
  3405. "全部",
  3406. 2
  3407. /* CLASS */
  3408. ),
  3409. vue.createElementVNode(
  3410. "view",
  3411. {
  3412. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.amount === "100以下" }]),
  3413. onClick: _cache[6] || (_cache[6] = ($event) => _ctx.selectAmount("100以下"))
  3414. },
  3415. "100以下",
  3416. 2
  3417. /* CLASS */
  3418. ),
  3419. vue.createElementVNode(
  3420. "view",
  3421. {
  3422. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.amount === "100-200" }]),
  3423. onClick: _cache[7] || (_cache[7] = ($event) => _ctx.selectAmount("100-200"))
  3424. },
  3425. "100-200",
  3426. 2
  3427. /* CLASS */
  3428. ),
  3429. vue.createElementVNode(
  3430. "view",
  3431. {
  3432. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.amount === "200-500" }]),
  3433. onClick: _cache[8] || (_cache[8] = ($event) => _ctx.selectAmount("200-500"))
  3434. },
  3435. "200-500",
  3436. 2
  3437. /* CLASS */
  3438. ),
  3439. vue.createElementVNode(
  3440. "view",
  3441. {
  3442. class: vue.normalizeClass(["option-btn", { active: _ctx.tempFilter.amount === "500以上" }]),
  3443. onClick: _cache[9] || (_cache[9] = ($event) => _ctx.selectAmount("500以上"))
  3444. },
  3445. "500以上",
  3446. 2
  3447. /* CLASS */
  3448. )
  3449. ])
  3450. ]),
  3451. vue.createElementVNode("view", { class: "filter-actions" }, [
  3452. vue.createElementVNode("button", {
  3453. class: "action-btn reset",
  3454. onClick: _cache[10] || (_cache[10] = (...args) => _ctx.resetFilter && _ctx.resetFilter(...args))
  3455. }, "重置"),
  3456. vue.createElementVNode("button", {
  3457. class: "action-btn confirm",
  3458. onClick: _cache[11] || (_cache[11] = (...args) => _ctx.confirmFilter && _ctx.confirmFilter(...args))
  3459. }, "确认")
  3460. ])
  3461. ],
  3462. 2
  3463. /* CLASS */
  3464. )
  3465. ]),
  3466. vue.createElementVNode("view", { class: "task-list-container" }, [
  3467. vue.createElementVNode("view", { class: "task-list" }, [
  3468. (vue.openBlock(true), vue.createElementBlock(
  3469. vue.Fragment,
  3470. null,
  3471. vue.renderList(_ctx.taskList, (item) => {
  3472. return vue.openBlock(), vue.createElementBlock("view", {
  3473. class: "task-card",
  3474. key: item.id,
  3475. onClick: ($event) => _ctx.goToDetail(item)
  3476. }, [
  3477. vue.createElementVNode("view", { class: "card-header" }, [
  3478. vue.createElementVNode("view", { class: "type-badge" }, [
  3479. vue.createElementVNode("image", {
  3480. class: "type-icon",
  3481. src: item.typeIcon
  3482. }, null, 8, ["src"]),
  3483. vue.createElementVNode(
  3484. "text",
  3485. { class: "type-text" },
  3486. vue.toDisplayString(item.typeText),
  3487. 1
  3488. /* TEXT */
  3489. )
  3490. ]),
  3491. vue.createElementVNode(
  3492. "text",
  3493. { class: "price" },
  3494. "¥" + vue.toDisplayString(item.price),
  3495. 1
  3496. /* TEXT */
  3497. )
  3498. ]),
  3499. vue.createElementVNode("view", { class: "card-body" }, [
  3500. vue.createElementVNode("view", { class: "time-row" }, [
  3501. vue.createElementVNode(
  3502. "text",
  3503. { class: "label" },
  3504. vue.toDisplayString(item.timeLabel) + ":",
  3505. 1
  3506. /* TEXT */
  3507. ),
  3508. vue.createElementVNode(
  3509. "text",
  3510. { class: "value" },
  3511. vue.toDisplayString(item.time),
  3512. 1
  3513. /* TEXT */
  3514. )
  3515. ]),
  3516. vue.createElementVNode("view", { class: "pet-card" }, [
  3517. vue.createElementVNode("image", {
  3518. class: "pet-avatar",
  3519. src: item.petAvatarUrl || item.petAvatar,
  3520. mode: "aspectFill"
  3521. }, null, 8, ["src"]),
  3522. vue.createElementVNode("view", { class: "pet-info" }, [
  3523. vue.createElementVNode(
  3524. "text",
  3525. { class: "pet-name" },
  3526. vue.toDisplayString(item.petName),
  3527. 1
  3528. /* TEXT */
  3529. ),
  3530. vue.createElementVNode(
  3531. "text",
  3532. { class: "pet-breed" },
  3533. "品种: " + vue.toDisplayString(item.petBreed),
  3534. 1
  3535. /* TEXT */
  3536. )
  3537. ])
  3538. ]),
  3539. vue.createElementVNode("view", { class: "route-info" }, [
  3540. item.type === 1 ? (vue.openBlock(), vue.createElementBlock(
  3541. vue.Fragment,
  3542. { key: 0 },
  3543. [
  3544. vue.createElementVNode("view", {
  3545. class: "route-item",
  3546. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "start"), ["stop"])
  3547. }, [
  3548. vue.createElementVNode("view", { class: "icon-circle start" }, "起"),
  3549. vue.createElementVNode("view", { class: "route-line-vertical" }),
  3550. vue.createElementVNode("view", { class: "address-box" }, [
  3551. vue.createElementVNode(
  3552. "text",
  3553. { class: "addr-title" },
  3554. vue.toDisplayString(item.startLocation),
  3555. 1
  3556. /* TEXT */
  3557. ),
  3558. vue.createElementVNode(
  3559. "text",
  3560. { class: "addr-desc" },
  3561. vue.toDisplayString(item.startAddress),
  3562. 1
  3563. /* TEXT */
  3564. )
  3565. ]),
  3566. vue.createElementVNode("image", {
  3567. class: "nav-arrow",
  3568. src: _imports_3$2,
  3569. style: { "flex-shrink": "0", "align-self": "center" }
  3570. })
  3571. ], 8, ["onClick"]),
  3572. vue.createElementVNode("view", {
  3573. class: "route-item",
  3574. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "end"), ["stop"])
  3575. }, [
  3576. vue.createElementVNode("view", { class: "icon-circle end" }, "终"),
  3577. vue.createElementVNode("view", { class: "address-box" }, [
  3578. vue.createElementVNode(
  3579. "text",
  3580. { class: "addr-title" },
  3581. vue.toDisplayString(item.endLocation),
  3582. 1
  3583. /* TEXT */
  3584. ),
  3585. vue.createElementVNode(
  3586. "text",
  3587. { class: "addr-desc" },
  3588. vue.toDisplayString(item.endAddress),
  3589. 1
  3590. /* TEXT */
  3591. )
  3592. ]),
  3593. vue.createElementVNode("image", {
  3594. class: "nav-arrow",
  3595. src: _imports_3$2,
  3596. style: { "flex-shrink": "0", "align-self": "center" }
  3597. })
  3598. ], 8, ["onClick"])
  3599. ],
  3600. 64
  3601. /* STABLE_FRAGMENT */
  3602. )) : (vue.openBlock(), vue.createElementBlock(
  3603. vue.Fragment,
  3604. { key: 1 },
  3605. [
  3606. vue.createElementVNode("view", {
  3607. class: "route-item",
  3608. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "end"), ["stop"])
  3609. }, [
  3610. vue.createElementVNode("view", { class: "icon-circle service" }, "服"),
  3611. vue.createElementVNode("view", { class: "address-box" }, [
  3612. vue.createElementVNode(
  3613. "text",
  3614. { class: "addr-title" },
  3615. vue.toDisplayString(item.endLocation),
  3616. 1
  3617. /* TEXT */
  3618. ),
  3619. vue.createElementVNode(
  3620. "text",
  3621. { class: "addr-desc" },
  3622. vue.toDisplayString(item.endAddress),
  3623. 1
  3624. /* TEXT */
  3625. )
  3626. ]),
  3627. vue.createElementVNode("image", {
  3628. class: "nav-arrow",
  3629. src: _imports_3$2,
  3630. style: { "flex-shrink": "0", "align-self": "center" }
  3631. })
  3632. ], 8, ["onClick"]),
  3633. item.serviceContent ? (vue.openBlock(), vue.createElementBlock("view", {
  3634. key: 0,
  3635. class: "service-content"
  3636. }, [
  3637. vue.createElementVNode("text", { class: "content-label" }, "服务内容:"),
  3638. vue.createElementVNode(
  3639. "text",
  3640. null,
  3641. vue.toDisplayString(item.serviceContent),
  3642. 1
  3643. /* TEXT */
  3644. )
  3645. ])) : vue.createCommentVNode("v-if", true)
  3646. ],
  3647. 64
  3648. /* STABLE_FRAGMENT */
  3649. ))
  3650. ]),
  3651. item.remark ? (vue.openBlock(), vue.createElementBlock("view", {
  3652. key: 0,
  3653. class: "remark-box"
  3654. }, [
  3655. vue.createElementVNode(
  3656. "text",
  3657. null,
  3658. "备注:" + vue.toDisplayString(item.remark),
  3659. 1
  3660. /* TEXT */
  3661. )
  3662. ])) : vue.createCommentVNode("v-if", true)
  3663. ]),
  3664. vue.createElementVNode("view", { class: "action-btns" }, [
  3665. vue.createElementVNode("button", {
  3666. class: "btn reject",
  3667. onClick: vue.withModifiers(($event) => _ctx.openRejectModal(item), ["stop"])
  3668. }, "拒绝", 8, ["onClick"]),
  3669. vue.createElementVNode("button", {
  3670. class: "btn accept",
  3671. onClick: vue.withModifiers(($event) => _ctx.openAcceptModal(item), ["stop"])
  3672. }, "接单", 8, ["onClick"])
  3673. ])
  3674. ], 8, ["onClick"]);
  3675. }),
  3676. 128
  3677. /* KEYED_FRAGMENT */
  3678. )),
  3679. vue.createElementVNode("view", { style: { "height": "120rpx" } })
  3680. ])
  3681. ]),
  3682. _ctx.showConfirmModal ? (vue.openBlock(), vue.createElementBlock("view", {
  3683. key: 0,
  3684. class: "modal-mask"
  3685. }, [
  3686. vue.createElementVNode("view", { class: "custom-modal" }, [
  3687. vue.createElementVNode("text", { class: "modal-title" }, "提示"),
  3688. vue.createElementVNode("text", { class: "modal-content" }, "是否确定结束休息,开始接单?"),
  3689. vue.createElementVNode("view", { class: "modal-btns" }, [
  3690. vue.createElementVNode("button", {
  3691. class: "modal-btn cancel",
  3692. onClick: _cache[12] || (_cache[12] = (...args) => _ctx.closeConfirmModal && _ctx.closeConfirmModal(...args))
  3693. }, "取消"),
  3694. vue.createElementVNode("button", {
  3695. class: "modal-btn confirm",
  3696. onClick: _cache[13] || (_cache[13] = (...args) => _ctx.confirmStartWork && _ctx.confirmStartWork(...args))
  3697. }, "确定")
  3698. ])
  3699. ])
  3700. ])) : vue.createCommentVNode("v-if", true),
  3701. _ctx.showPetModal ? (vue.openBlock(), vue.createElementBlock("view", {
  3702. key: 1,
  3703. class: "pet-modal-mask",
  3704. onClick: _cache[17] || (_cache[17] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  3705. }, [
  3706. vue.createElementVNode("view", {
  3707. class: "pet-modal-content",
  3708. onClick: _cache[16] || (_cache[16] = vue.withModifiers(() => {
  3709. }, ["stop"]))
  3710. }, [
  3711. vue.createElementVNode("view", { class: "pet-modal-header" }, [
  3712. vue.createElementVNode("text", { class: "pet-modal-title" }, "宠物档案"),
  3713. vue.createElementVNode("view", {
  3714. class: "close-icon-btn",
  3715. onClick: _cache[14] || (_cache[14] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  3716. }, "×")
  3717. ]),
  3718. vue.createElementVNode("scroll-view", {
  3719. "scroll-y": "",
  3720. class: "pet-modal-scroll"
  3721. }, [
  3722. vue.createElementVNode("view", { class: "pet-base-info" }, [
  3723. vue.createElementVNode("image", {
  3724. class: "pm-avatar",
  3725. src: _ctx.currentPetInfo.petAvatar,
  3726. mode: "aspectFill"
  3727. }, null, 8, ["src"]),
  3728. vue.createElementVNode("view", { class: "pm-info-text" }, [
  3729. vue.createElementVNode("view", { class: "pm-name-row" }, [
  3730. vue.createElementVNode(
  3731. "text",
  3732. { class: "pm-name" },
  3733. vue.toDisplayString(_ctx.currentPetInfo.petName),
  3734. 1
  3735. /* TEXT */
  3736. ),
  3737. _ctx.currentPetInfo.petGender === "M" ? (vue.openBlock(), vue.createElementBlock("view", {
  3738. key: 0,
  3739. class: "pm-gender"
  3740. }, [
  3741. vue.createElementVNode("text", { class: "gender-icon" }, "♂"),
  3742. vue.createElementVNode("text", null, "公")
  3743. ])) : _ctx.currentPetInfo.petGender === "F" ? (vue.openBlock(), vue.createElementBlock("view", {
  3744. key: 1,
  3745. class: "pm-gender female"
  3746. }, [
  3747. vue.createElementVNode("text", { class: "gender-icon" }, "♀"),
  3748. vue.createElementVNode("text", null, "母")
  3749. ])) : vue.createCommentVNode("v-if", true)
  3750. ]),
  3751. vue.createElementVNode(
  3752. "text",
  3753. { class: "pm-breed" },
  3754. "品种:" + vue.toDisplayString(_ctx.currentPetInfo.petBreed),
  3755. 1
  3756. /* TEXT */
  3757. )
  3758. ])
  3759. ]),
  3760. vue.createElementVNode("view", { class: "pm-detail-grid" }, [
  3761. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  3762. vue.createElementVNode("text", { class: "pm-label" }, "年龄"),
  3763. vue.createElementVNode(
  3764. "text",
  3765. { class: "pm-val" },
  3766. vue.toDisplayString(_ctx.currentPetInfo.petAge || "未知"),
  3767. 1
  3768. /* TEXT */
  3769. )
  3770. ]),
  3771. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  3772. vue.createElementVNode("text", { class: "pm-label" }, "体重"),
  3773. vue.createElementVNode(
  3774. "text",
  3775. { class: "pm-val" },
  3776. vue.toDisplayString(_ctx.currentPetInfo.petWeight || "未知"),
  3777. 1
  3778. /* TEXT */
  3779. )
  3780. ]),
  3781. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  3782. vue.createElementVNode("text", { class: "pm-label" }, "性格"),
  3783. vue.createElementVNode(
  3784. "text",
  3785. { class: "pm-val" },
  3786. vue.toDisplayString(_ctx.currentPetInfo.petPersonality || "无"),
  3787. 1
  3788. /* TEXT */
  3789. )
  3790. ]),
  3791. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  3792. vue.createElementVNode("text", { class: "pm-label" }, "爱好"),
  3793. vue.createElementVNode(
  3794. "text",
  3795. { class: "pm-val" },
  3796. vue.toDisplayString(_ctx.currentPetInfo.petHobby || "无"),
  3797. 1
  3798. /* TEXT */
  3799. )
  3800. ]),
  3801. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  3802. vue.createElementVNode("text", { class: "pm-label" }, "备注"),
  3803. vue.createElementVNode(
  3804. "text",
  3805. { class: "pm-val" },
  3806. vue.toDisplayString(_ctx.currentPetInfo.petRemark || "无特殊过敏史"),
  3807. 1
  3808. /* TEXT */
  3809. )
  3810. ])
  3811. ]),
  3812. _ctx.currentPetInfo.petTags && _ctx.currentPetInfo.petTags.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  3813. key: 0,
  3814. class: "pm-tags"
  3815. }, [
  3816. (vue.openBlock(true), vue.createElementBlock(
  3817. vue.Fragment,
  3818. null,
  3819. vue.renderList(_ctx.currentPetInfo.petTags, (tag, index) => {
  3820. return vue.openBlock(), vue.createElementBlock(
  3821. "view",
  3822. {
  3823. class: "pm-tag",
  3824. key: index
  3825. },
  3826. vue.toDisplayString(tag),
  3827. 1
  3828. /* TEXT */
  3829. );
  3830. }),
  3831. 128
  3832. /* KEYED_FRAGMENT */
  3833. ))
  3834. ])) : vue.createCommentVNode("v-if", true),
  3835. vue.createElementVNode("view", { class: "pm-section-title" }, [
  3836. vue.createElementVNode("view", { class: "orange-bar" }),
  3837. vue.createElementVNode("text", null, "备注日志")
  3838. ]),
  3839. vue.createElementVNode("view", { class: "pm-log-list" }, [
  3840. (vue.openBlock(true), vue.createElementBlock(
  3841. vue.Fragment,
  3842. null,
  3843. vue.renderList(_ctx.currentPetInfo.petLogs, (log, lIndex) => {
  3844. return vue.openBlock(), vue.createElementBlock("view", {
  3845. class: "pm-log-item",
  3846. key: lIndex
  3847. }, [
  3848. vue.createElementVNode(
  3849. "text",
  3850. { class: "pm-log-date" },
  3851. vue.toDisplayString(log.date),
  3852. 1
  3853. /* TEXT */
  3854. ),
  3855. vue.createElementVNode(
  3856. "text",
  3857. { class: "pm-log-text" },
  3858. vue.toDisplayString(log.content),
  3859. 1
  3860. /* TEXT */
  3861. ),
  3862. vue.createElementVNode(
  3863. "text",
  3864. { class: "pm-log-recorder" },
  3865. vue.toDisplayString(log.recorder === "系统记录" ? "" : "记录人: ") + vue.toDisplayString(log.recorder),
  3866. 1
  3867. /* TEXT */
  3868. )
  3869. ]);
  3870. }),
  3871. 128
  3872. /* KEYED_FRAGMENT */
  3873. ))
  3874. ]),
  3875. vue.createElementVNode("view", { style: { "height": "40rpx" } }),
  3876. vue.createElementVNode("button", {
  3877. class: "pm-bottom-close",
  3878. onClick: _cache[15] || (_cache[15] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  3879. }, "关闭"),
  3880. vue.createElementVNode("view", { style: { "height": "20rpx" } })
  3881. ])
  3882. ])
  3883. ])) : vue.createCommentVNode("v-if", true)
  3884. ]),
  3885. _ctx.showRejectModal ? (vue.openBlock(), vue.createElementBlock("view", {
  3886. key: 0,
  3887. class: "modal-mask"
  3888. }, [
  3889. vue.createElementVNode("view", { class: "custom-modal" }, [
  3890. vue.createElementVNode("text", { class: "modal-title" }, "拒绝接单"),
  3891. vue.withDirectives(vue.createElementVNode(
  3892. "textarea",
  3893. {
  3894. class: "reject-textarea",
  3895. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => _ctx.rejectReason = $event),
  3896. placeholder: "请输入拒绝理由(必填)",
  3897. maxlength: "100"
  3898. },
  3899. null,
  3900. 512
  3901. /* NEED_PATCH */
  3902. ), [
  3903. [vue.vModelText, _ctx.rejectReason]
  3904. ]),
  3905. vue.createElementVNode("view", { class: "modal-btns mt-30" }, [
  3906. vue.createElementVNode("button", {
  3907. class: "modal-btn cancel",
  3908. onClick: _cache[19] || (_cache[19] = (...args) => _ctx.closeRejectModal && _ctx.closeRejectModal(...args))
  3909. }, "取消"),
  3910. vue.createElementVNode("button", {
  3911. class: "modal-btn confirm",
  3912. onClick: _cache[20] || (_cache[20] = (...args) => _ctx.confirmReject && _ctx.confirmReject(...args))
  3913. }, "提交")
  3914. ])
  3915. ])
  3916. ])) : vue.createCommentVNode("v-if", true),
  3917. _ctx.showAcceptConfirmModal ? (vue.openBlock(), vue.createElementBlock("view", {
  3918. key: 1,
  3919. class: "modal-mask"
  3920. }, [
  3921. vue.createElementVNode("view", { class: "custom-modal" }, [
  3922. vue.createElementVNode("text", { class: "modal-title" }, "接单确认"),
  3923. vue.createElementVNode("view", { class: "modal-content-box" }, [
  3924. vue.createElementVNode("text", { class: "modal-content-main" }, "请确认是否接收此订单?"),
  3925. vue.createElementVNode("text", { class: "modal-content-sub" }, "接单后请尽快通过电话联系用户")
  3926. ]),
  3927. vue.createElementVNode("view", { class: "modal-btns mt-30" }, [
  3928. vue.createElementVNode("button", {
  3929. class: "modal-btn cancel",
  3930. onClick: _cache[21] || (_cache[21] = (...args) => _ctx.closeAcceptModal && _ctx.closeAcceptModal(...args))
  3931. }, "再想想"),
  3932. vue.createElementVNode("button", {
  3933. class: "modal-btn confirm",
  3934. onClick: _cache[22] || (_cache[22] = (...args) => _ctx.confirmAccept && _ctx.confirmAccept(...args))
  3935. }, "确认接单")
  3936. ])
  3937. ])
  3938. ])) : vue.createCommentVNode("v-if", true),
  3939. _ctx.showNavModal ? (vue.openBlock(), vue.createElementBlock("view", {
  3940. key: 2,
  3941. class: "nav-modal-mask",
  3942. onClick: _cache[28] || (_cache[28] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  3943. }, [
  3944. vue.createElementVNode("view", {
  3945. class: "nav-action-sheet",
  3946. onClick: _cache[27] || (_cache[27] = vue.withModifiers(() => {
  3947. }, ["stop"]))
  3948. }, [
  3949. vue.createElementVNode("view", { class: "nav-sheet-title" }, "选择地图进行导航"),
  3950. vue.createElementVNode("view", {
  3951. class: "nav-sheet-item",
  3952. onClick: _cache[23] || (_cache[23] = ($event) => _ctx.chooseMap("高德"))
  3953. }, "高德地图"),
  3954. vue.createElementVNode("view", {
  3955. class: "nav-sheet-item",
  3956. onClick: _cache[24] || (_cache[24] = ($event) => _ctx.chooseMap("腾讯"))
  3957. }, "腾讯地图"),
  3958. vue.createElementVNode("view", {
  3959. class: "nav-sheet-item",
  3960. onClick: _cache[25] || (_cache[25] = ($event) => _ctx.chooseMap("百度"))
  3961. }, "百度地图"),
  3962. vue.createElementVNode("view", { class: "nav-sheet-gap" }),
  3963. vue.createElementVNode("view", {
  3964. class: "nav-sheet-item cancel",
  3965. onClick: _cache[26] || (_cache[26] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  3966. }, "取消")
  3967. ])
  3968. ])) : vue.createCommentVNode("v-if", true),
  3969. vue.createVNode(_component_custom_tabbar, { currentPath: "pages/home/index" })
  3970. ],
  3971. 64
  3972. /* STABLE_FRAGMENT */
  3973. );
  3974. }
  3975. const PagesHomeIndex = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/home/index.vue"]]);
  3976. const _sfc_main$t = {
  3977. data() {
  3978. return {
  3979. status: "resting",
  3980. // resting | busy | disabled
  3981. loading: false
  3982. };
  3983. },
  3984. onShow() {
  3985. const savedStatus = uni.getStorageSync("workStatus");
  3986. if (savedStatus) {
  3987. this.status = savedStatus;
  3988. }
  3989. this.fetchLatestProfile();
  3990. },
  3991. methods: {
  3992. async fetchLatestProfile() {
  3993. try {
  3994. const res = await getMyProfile();
  3995. if (res.data && res.data.status) {
  3996. this.status = res.data.status;
  3997. uni.setStorageSync("workStatus", this.status);
  3998. }
  3999. } catch (err) {
  4000. formatAppLog("error", "at pages/home/work-status.vue:64", "获取状态失败:", err);
  4001. }
  4002. },
  4003. async toggleStatus() {
  4004. if (this.loading)
  4005. return;
  4006. const targetStatus = this.status === "busy" ? "resting" : "busy";
  4007. const actionText = targetStatus === "busy" ? "恢复接单" : "停止接单";
  4008. try {
  4009. uni.showLoading({ title: "处理中...", mask: true });
  4010. this.loading = true;
  4011. await updateStatus(targetStatus);
  4012. await this.fetchLatestProfile();
  4013. uni.hideLoading();
  4014. uni.showToast({ title: actionText + "成功", icon: "success" });
  4015. } catch (err) {
  4016. uni.hideLoading();
  4017. formatAppLog("error", "at pages/home/work-status.vue:88", "切换状态失败:", err);
  4018. uni.showToast({ title: "操作失败,请重试", icon: "none" });
  4019. } finally {
  4020. this.loading = false;
  4021. }
  4022. }
  4023. }
  4024. };
  4025. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  4026. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  4027. vue.createElementVNode("view", { class: "signboard-container" }, [
  4028. vue.createElementVNode("view", { class: "rope" }),
  4029. vue.createElementVNode("view", { class: "nail" }),
  4030. vue.createElementVNode(
  4031. "view",
  4032. {
  4033. class: vue.normalizeClass(["board", { "resting": $data.status !== "busy" }])
  4034. },
  4035. [
  4036. vue.createElementVNode("view", { class: "screw top-left" }),
  4037. vue.createElementVNode("view", { class: "screw top-right" }),
  4038. vue.createElementVNode("view", { class: "screw bottom-left" }),
  4039. vue.createElementVNode("view", { class: "screw bottom-right" }),
  4040. vue.createElementVNode("view", { class: "board-inner" }, [
  4041. vue.createElementVNode(
  4042. "text",
  4043. { class: "status-text" },
  4044. vue.toDisplayString($data.status === "busy" ? "接单中" : "休息中"),
  4045. 1
  4046. /* TEXT */
  4047. )
  4048. ])
  4049. ],
  4050. 2
  4051. /* CLASS */
  4052. )
  4053. ]),
  4054. vue.createElementVNode("view", { class: "status-desc" }, [
  4055. vue.createElementVNode(
  4056. "text",
  4057. null,
  4058. vue.toDisplayString($data.status === "busy" ? "当前处于工作接单中,正常接收新订单" : "当前处于休息状态,暂停接收新订单"),
  4059. 1
  4060. /* TEXT */
  4061. )
  4062. ]),
  4063. vue.createElementVNode("view", { class: "action-area" }, [
  4064. vue.createElementVNode(
  4065. "button",
  4066. {
  4067. class: vue.normalizeClass(["action-btn", { "stop": $data.status === "busy", "start": $data.status !== "busy" }]),
  4068. onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleStatus && $options.toggleStatus(...args))
  4069. },
  4070. vue.toDisplayString($data.status === "busy" ? "停止接单" : "开始接单"),
  4071. 3
  4072. /* TEXT, CLASS */
  4073. ),
  4074. vue.createElementVNode("view", { class: "tips" }, [
  4075. $data.status === "busy" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "当您希望长时间不再接收订单时,请点击上方按钮停止接单,开启后需手动恢复。")) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "点击上方按钮恢复接单,开始接收新的任务推送。"))
  4076. ])
  4077. ])
  4078. ]);
  4079. }
  4080. const PagesHomeWorkStatus = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/home/work-status.vue"]]);
  4081. const logic$2 = {
  4082. components: {
  4083. customTabbar
  4084. },
  4085. data() {
  4086. return {
  4087. currentTab: 0,
  4088. tabs: ["待接送/服务", "配送/服务中", "已完成", "已取消"],
  4089. typeFilterOptions: ["全部类型"],
  4090. currentTypeFilterIdx: 0,
  4091. activeDropdown: 0,
  4092. hasTimeFilter: false,
  4093. currentMonth: "2026年2月",
  4094. weekDays: ["日", "一", "二", "三", "四", "五", "六"],
  4095. calendarDays: [],
  4096. selectedDateRange: [],
  4097. allOrderList: [],
  4098. serviceList: [],
  4099. searchContent: "",
  4100. startServiceTime: "",
  4101. endServiceTime: "",
  4102. showPetModal: false,
  4103. currentPetInfo: {},
  4104. showNavModal: false,
  4105. navTargetItem: null,
  4106. navTargetPointType: "",
  4107. activeCallItem: null,
  4108. showRemarkInput: false,
  4109. remarkText: ""
  4110. };
  4111. },
  4112. created() {
  4113. this.initCalendar();
  4114. },
  4115. async onLoad() {
  4116. await this.loadServiceList();
  4117. await this.loadOrders();
  4118. reportGps(true).catch((e) => formatAppLog("log", "at pages/orders/logic.js:44", "Init GPS check skipped", e));
  4119. },
  4120. onShow() {
  4121. uni.hideTabBar();
  4122. this.loadOrders();
  4123. },
  4124. async onPullDownRefresh() {
  4125. try {
  4126. await this.loadServiceList();
  4127. await this.loadOrders();
  4128. } finally {
  4129. uni.stopPullDownRefresh();
  4130. }
  4131. },
  4132. watch: {
  4133. currentTab() {
  4134. this.loadOrders();
  4135. },
  4136. currentTypeFilterIdx() {
  4137. this.loadOrders();
  4138. },
  4139. searchContent() {
  4140. this.loadOrders();
  4141. }
  4142. },
  4143. computed: {
  4144. orderList() {
  4145. return this.allOrderList;
  4146. }
  4147. },
  4148. methods: {
  4149. async loadServiceList() {
  4150. try {
  4151. const res = await listAllService();
  4152. this.serviceList = res.data || [];
  4153. this.typeFilterOptions = ["全部类型", ...this.serviceList.map((s) => s.name)];
  4154. } catch (err) {
  4155. formatAppLog("error", "at pages/orders/logic.js:84", "获取服务类型失败:", err);
  4156. }
  4157. },
  4158. async loadOrders() {
  4159. var _a;
  4160. try {
  4161. const statusMap = { 0: 2, 1: 3, 2: 4, 3: 5 };
  4162. const serviceId = this.currentTypeFilterIdx > 0 ? (_a = this.serviceList[this.currentTypeFilterIdx - 1]) == null ? void 0 : _a.id : void 0;
  4163. const params = {
  4164. status: statusMap[this.currentTab],
  4165. content: this.searchContent || void 0,
  4166. service: serviceId,
  4167. startServiceTime: this.startServiceTime || void 0,
  4168. endServiceTime: this.endServiceTime || void 0
  4169. };
  4170. formatAppLog("log", "at pages/orders/logic.js:98", "订单列表请求参数:", params);
  4171. const res = await getMyOrders(params);
  4172. formatAppLog("log", "at pages/orders/logic.js:100", "订单列表响应:", res);
  4173. const orders = res.rows || [];
  4174. formatAppLog("log", "at pages/orders/logic.js:102", "订单数量:", orders.length);
  4175. this.allOrderList = orders.map((order) => this.transformOrder(order, this.currentTab));
  4176. } catch (err) {
  4177. formatAppLog("error", "at pages/orders/logic.js:105", "获取订单列表失败:", err);
  4178. this.allOrderList = [];
  4179. }
  4180. },
  4181. transformOrder(order, tabIndex) {
  4182. const service = this.serviceList.find((s) => s.id === order.service);
  4183. const serviceText = (service == null ? void 0 : service.name) || "未知";
  4184. const serviceIcon = (service == null ? void 0 : service.iconUrl) || "";
  4185. const mode = (service == null ? void 0 : service.mode) || 0;
  4186. const isRoundTrip = mode === 1;
  4187. let statusText = "接单";
  4188. if (tabIndex === 0) {
  4189. statusText = "接单";
  4190. } else if (tabIndex === 1) {
  4191. statusText = isRoundTrip ? "出发" : "开始";
  4192. } else if (tabIndex === 2) {
  4193. statusText = "已完成";
  4194. } else if (tabIndex === 3) {
  4195. statusText = "已拒绝";
  4196. }
  4197. return {
  4198. id: order.id,
  4199. status: order.status,
  4200. // 保存原始 status 用于判断权限
  4201. type: isRoundTrip ? 1 : 2,
  4202. typeText: serviceText,
  4203. typeIcon: serviceIcon,
  4204. statusText,
  4205. price: (order.price / 100).toFixed(2),
  4206. timeLabel: "服务时间",
  4207. time: order.serviceTime || "",
  4208. petAvatar: order.petAvatar || "/static/dog.png",
  4209. petAvatarUrl: order.petAvatarUrl || "",
  4210. petName: order.petName || "",
  4211. petBreed: order.breed || "",
  4212. startLocation: order.fromAddress || "暂无起点",
  4213. startAddress: order.fromAddress || "",
  4214. fromAddress: order.fromAddress || "",
  4215. fromLat: order.fromLat,
  4216. fromLng: order.fromLng,
  4217. startDistance: "0km",
  4218. endLocation: (order.customerName || "") + " " + (order.customerPhone || ""),
  4219. endAddress: order.toAddress || "",
  4220. toAddress: order.toAddress || "",
  4221. toLat: order.toLat,
  4222. toLng: order.toLng,
  4223. customerPhone: order.customerPhone || "",
  4224. endDistance: "0km",
  4225. serviceContent: order.remark || "",
  4226. remark: order.remark || ""
  4227. };
  4228. },
  4229. getDisplayStatus(item) {
  4230. if (item.statusText === "已完成")
  4231. return "已完成";
  4232. if (item.statusText === "已拒绝")
  4233. return "已拒绝";
  4234. if (item.statusText === "接单") {
  4235. return item.type === 1 ? "待接送" : "待服务";
  4236. }
  4237. return item.type === 1 ? "配送中" : "服务中";
  4238. },
  4239. getStatusClass(item) {
  4240. let display = this.getDisplayStatus(item);
  4241. if (display === "已完成")
  4242. return "finish";
  4243. if (display === "已拒绝")
  4244. return "reject";
  4245. if (display === "配送中" || display === "服务中")
  4246. return "processing";
  4247. return "highlight";
  4248. },
  4249. goToDetail(item) {
  4250. uni.navigateTo({ url: `/pages/orders/detail?id=${item.id}` });
  4251. },
  4252. showPetProfile(item) {
  4253. this.currentPetInfo = {
  4254. ...item,
  4255. petGender: "M",
  4256. petAge: "2岁",
  4257. petWeight: "15kg",
  4258. petPersonality: "活泼亲人,精力旺盛",
  4259. petHobby: "喜欢追飞盘,爱吃肉干",
  4260. petRemark: "肠胃较弱,不能乱喂零食;出门易爆冲,请拉紧牵引绳。",
  4261. petTags: ["拉响警报", "不能吃鸡肉", "精力旺盛"],
  4262. petLogs: [
  4263. { date: "2026-02-09 14:00", content: "今天遛弯拉了两次粑粑,精神状态很好。", recorder: "王阿姨" },
  4264. { date: "2026-02-08 10:30", content: "有些挑食,剩了小半碗狗粮。", recorder: "李师傅" },
  4265. { date: "2026-02-05 09:00", content: "建档。", recorder: "系统记录" }
  4266. ]
  4267. };
  4268. this.showPetModal = true;
  4269. },
  4270. closePetProfile() {
  4271. this.showPetModal = false;
  4272. },
  4273. openNavigation(item, pointType) {
  4274. this.navTargetItem = item;
  4275. this.navTargetPointType = pointType;
  4276. this.showNavModal = true;
  4277. },
  4278. closeNavModal() {
  4279. this.showNavModal = false;
  4280. },
  4281. chooseMap(mapType) {
  4282. let item = this.navTargetItem;
  4283. let pointType = this.navTargetPointType;
  4284. let name = pointType === "start" ? item.fromAddress || "起点" : item.toAddress || "终点";
  4285. let address = pointType === "start" ? item.fromAddress || "起点地址" : item.toAddress || "终点地址";
  4286. let latitude = pointType === "start" ? Number(item.fromLat) : Number(item.toLat);
  4287. let longitude = pointType === "start" ? Number(item.fromLng) : Number(item.toLng);
  4288. this.showNavModal = false;
  4289. const navigateTo = (lat, lng, addrName, addrDesc) => {
  4290. uni.openLocation({
  4291. latitude: lat,
  4292. longitude: lng,
  4293. name: addrName,
  4294. address: addrDesc || "无法获取详细地址",
  4295. success: function() {
  4296. formatAppLog("log", "at pages/orders/logic.js:224", "打开导航成功: " + mapType);
  4297. },
  4298. fail: function(err) {
  4299. formatAppLog("error", "at pages/orders/logic.js:227", "打开导航失败:", err);
  4300. uni.showToast({ title: "打开地图失败", icon: "none" });
  4301. }
  4302. });
  4303. };
  4304. if (latitude && longitude && !isNaN(latitude) && !isNaN(longitude)) {
  4305. navigateTo(latitude, longitude, name, address);
  4306. } else {
  4307. uni.showLoading({ title: "获取当前位置...", mask: true });
  4308. reportGps(true).then((res) => {
  4309. uni.hideLoading();
  4310. navigateTo(res.latitude, res.longitude, name, address);
  4311. }).catch((err) => {
  4312. uni.hideLoading();
  4313. formatAppLog("error", "at pages/orders/logic.js:245", "获取地理位置失败:", err);
  4314. });
  4315. }
  4316. },
  4317. toggleCallMenu(item) {
  4318. if (this.activeCallItem === item) {
  4319. this.activeCallItem = null;
  4320. } else {
  4321. this.activeCallItem = item;
  4322. }
  4323. },
  4324. closeCallMenu() {
  4325. this.activeCallItem = null;
  4326. },
  4327. doCall(type, item) {
  4328. let phoneNum = "";
  4329. const targetItem = item || this.activeCallItem;
  4330. if (type === "merchant") {
  4331. phoneNum = "18900008451";
  4332. } else if (type === "customer") {
  4333. phoneNum = targetItem == null ? void 0 : targetItem.customerPhone;
  4334. }
  4335. if (!phoneNum) {
  4336. uni.showToast({ title: "未找到电话号码", icon: "none" });
  4337. this.activeCallItem = null;
  4338. return;
  4339. }
  4340. phoneNum = phoneNum.replace(/[^\d]/g, "");
  4341. if (phoneNum.length < 3) {
  4342. uni.showToast({ title: "电话号码格式错误", icon: "none" });
  4343. this.activeCallItem = null;
  4344. return;
  4345. }
  4346. formatAppLog("log", "at pages/orders/logic.js:288", "正在发起直接呼叫:", phoneNum);
  4347. uni.makePhoneCall({
  4348. phoneNumber: phoneNum,
  4349. success: () => {
  4350. formatAppLog("log", "at pages/orders/logic.js:296", "成功唤起系统拨号盘");
  4351. },
  4352. fail: (err) => {
  4353. formatAppLog("error", "at pages/orders/logic.js:299", "拨号失败:", err);
  4354. let msg = "拨号失败";
  4355. if (err.message && err.message.includes("permission")) {
  4356. msg = '请在手机设置中允许"电话"权限';
  4357. }
  4358. uni.showToast({ title: msg, icon: "none", duration: 3e3 });
  4359. },
  4360. complete: () => {
  4361. this.activeCallItem = null;
  4362. }
  4363. });
  4364. },
  4365. reportAbnormal(item) {
  4366. uni.navigateTo({ url: "/pages/orders/anomaly?orderId=" + (item.id || "") });
  4367. },
  4368. toggleDropdown(idx) {
  4369. if (this.activeDropdown === idx) {
  4370. this.activeDropdown = 0;
  4371. } else {
  4372. this.activeDropdown = idx;
  4373. }
  4374. },
  4375. closeDropdown() {
  4376. this.activeDropdown = 0;
  4377. },
  4378. selectType(index) {
  4379. this.currentTypeFilterIdx = index;
  4380. this.closeDropdown();
  4381. },
  4382. initCalendar() {
  4383. let days = [];
  4384. for (let i = 1; i <= 28; i++) {
  4385. days.push(i);
  4386. }
  4387. this.calendarDays = days;
  4388. this.selectedDateRange = [2, 4];
  4389. },
  4390. prevMonth() {
  4391. uni.showToast({ title: "上个月", icon: "none" });
  4392. },
  4393. nextMonth() {
  4394. uni.showToast({ title: "下个月", icon: "none" });
  4395. },
  4396. selectDateItem(day) {
  4397. if (this.selectedDateRange.length === 2) {
  4398. this.selectedDateRange = [day];
  4399. } else if (this.selectedDateRange.length === 1) {
  4400. let start = this.selectedDateRange[0];
  4401. if (day > start) {
  4402. this.selectedDateRange = [start, day];
  4403. } else if (day < start) {
  4404. this.selectedDateRange = [day, start];
  4405. } else {
  4406. this.selectedDateRange = [];
  4407. }
  4408. } else {
  4409. this.selectedDateRange = [day];
  4410. }
  4411. },
  4412. getDateClass(day) {
  4413. if (this.selectedDateRange.length === 0)
  4414. return "";
  4415. if (this.selectedDateRange.length === 1) {
  4416. return day === this.selectedDateRange[0] ? "is-start" : "";
  4417. }
  4418. let start = this.selectedDateRange[0];
  4419. let end = this.selectedDateRange[1];
  4420. if (day === start)
  4421. return "is-start";
  4422. if (day === end)
  4423. return "is-end";
  4424. if (day > start && day < end)
  4425. return "is-between";
  4426. return "";
  4427. },
  4428. resetTimeFilter() {
  4429. this.hasTimeFilter = false;
  4430. this.selectedDateRange = [];
  4431. this.startServiceTime = "";
  4432. this.endServiceTime = "";
  4433. this.closeDropdown();
  4434. this.loadOrders();
  4435. },
  4436. confirmTimeFilter() {
  4437. if (this.selectedDateRange.length === 0) {
  4438. uni.showToast({ title: "请先选择日期", icon: "none" });
  4439. return;
  4440. }
  4441. const year = this.currentMonth.replace(/[^0-9]/g, "").substring(0, 4);
  4442. const month = this.currentMonth.replace(/[^0-9]/g, "").substring(4);
  4443. const pad = (n) => String(n).padStart(2, "0");
  4444. if (this.selectedDateRange.length === 2) {
  4445. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  4446. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[1])} 23:59:59`;
  4447. } else {
  4448. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  4449. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 23:59:59`;
  4450. }
  4451. this.hasTimeFilter = true;
  4452. this.closeDropdown();
  4453. this.loadOrders();
  4454. },
  4455. getMainActionText(item) {
  4456. return "查看详情";
  4457. },
  4458. mainAction(item) {
  4459. uni.navigateTo({ url: `/pages/orders/detail?id=${item.id}` });
  4460. },
  4461. openRemarkInput() {
  4462. this.remarkText = "";
  4463. this.showRemarkInput = true;
  4464. },
  4465. closeRemarkInput() {
  4466. this.showRemarkInput = false;
  4467. this.remarkText = "";
  4468. },
  4469. submitRemark() {
  4470. const text = this.remarkText.trim();
  4471. if (!text) {
  4472. uni.showToast({ title: "备注内容不能为空", icon: "none" });
  4473. return;
  4474. }
  4475. const now = /* @__PURE__ */ new Date();
  4476. const dateStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")} ${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
  4477. if (!this.currentPetInfo.petLogs) {
  4478. this.$set(this.currentPetInfo, "petLogs", []);
  4479. }
  4480. this.currentPetInfo.petLogs.unshift({
  4481. date: dateStr,
  4482. content: text,
  4483. recorder: "我"
  4484. });
  4485. uni.showToast({ title: "备注已添加", icon: "success" });
  4486. this.closeRemarkInput();
  4487. },
  4488. /**
  4489. * 取消订单处理逻辑
  4490. * @param {Object} item - 订单项
  4491. */
  4492. handleCancelOrder(item) {
  4493. uni.showModal({
  4494. title: "提示",
  4495. content: "确认是否取消这个订单?",
  4496. success: async (res) => {
  4497. if (res.confirm) {
  4498. try {
  4499. uni.showLoading({ title: "取消中...", mask: true });
  4500. await cancelOrderApi({ orderId: item.id });
  4501. uni.showToast({ title: "订单已取消", icon: "success" });
  4502. setTimeout(() => {
  4503. this.loadOrders();
  4504. }, 1500);
  4505. } catch (err) {
  4506. formatAppLog("error", "at pages/orders/logic.js:482", "取消订单失败:", err);
  4507. uni.showToast({ title: "取消失败", icon: "none" });
  4508. } finally {
  4509. uni.hideLoading();
  4510. }
  4511. }
  4512. }
  4513. });
  4514. }
  4515. }
  4516. };
  4517. const _sfc_main$s = {
  4518. ...logic$2
  4519. };
  4520. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  4521. const _component_custom_tabbar = vue.resolveComponent("custom-tabbar");
  4522. return vue.openBlock(), vue.createElementBlock(
  4523. vue.Fragment,
  4524. null,
  4525. [
  4526. vue.createElementVNode("view", { class: "container" }, [
  4527. vue.createElementVNode("view", { class: "sticky-header" }, [
  4528. vue.createElementVNode("view", { class: "status-tabs" }, [
  4529. (vue.openBlock(true), vue.createElementBlock(
  4530. vue.Fragment,
  4531. null,
  4532. vue.renderList(_ctx.tabs, (tab, index) => {
  4533. return vue.openBlock(), vue.createElementBlock("view", {
  4534. class: vue.normalizeClass(["tab-item", { active: _ctx.currentTab === index }]),
  4535. key: index,
  4536. onClick: ($event) => _ctx.currentTab = index
  4537. }, [
  4538. vue.createElementVNode(
  4539. "text",
  4540. null,
  4541. vue.toDisplayString(tab),
  4542. 1
  4543. /* TEXT */
  4544. ),
  4545. _ctx.currentTab === index ? (vue.openBlock(), vue.createElementBlock("view", {
  4546. key: 0,
  4547. class: "indicator"
  4548. })) : vue.createCommentVNode("v-if", true)
  4549. ], 10, ["onClick"]);
  4550. }),
  4551. 128
  4552. /* KEYED_FRAGMENT */
  4553. ))
  4554. ]),
  4555. vue.createElementVNode("view", { class: "search-bar" }, [
  4556. vue.createElementVNode("view", { class: "search-input-box" }, [
  4557. vue.withDirectives(vue.createElementVNode(
  4558. "input",
  4559. {
  4560. class: "search-input",
  4561. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.searchContent = $event),
  4562. placeholder: "搜索地址/电话/姓名",
  4563. "placeholder-class": "ph-style"
  4564. },
  4565. null,
  4566. 512
  4567. /* NEED_PATCH */
  4568. ), [
  4569. [vue.vModelText, _ctx.searchContent]
  4570. ])
  4571. ])
  4572. ]),
  4573. vue.createElementVNode("view", { class: "filter-wrapper" }, [
  4574. vue.createElementVNode("view", { class: "filter-bar" }, [
  4575. vue.createElementVNode(
  4576. "view",
  4577. {
  4578. class: vue.normalizeClass(["filter-item", { "active": _ctx.activeDropdown === 1 }]),
  4579. onClick: _cache[1] || (_cache[1] = ($event) => _ctx.toggleDropdown(1))
  4580. },
  4581. [
  4582. vue.createElementVNode(
  4583. "text",
  4584. {
  4585. class: vue.normalizeClass({ "active-text": _ctx.activeDropdown === 1 || _ctx.currentTypeFilterIdx > 0 })
  4586. },
  4587. vue.toDisplayString(_ctx.currentTypeFilterIdx > 0 ? _ctx.typeFilterOptions[_ctx.currentTypeFilterIdx] : "全部类型"),
  4588. 3
  4589. /* TEXT, CLASS */
  4590. ),
  4591. vue.createElementVNode(
  4592. "view",
  4593. {
  4594. class: vue.normalizeClass(["triangle", _ctx.activeDropdown === 1 ? "up" : "down"])
  4595. },
  4596. null,
  4597. 2
  4598. /* CLASS */
  4599. )
  4600. ],
  4601. 2
  4602. /* CLASS */
  4603. ),
  4604. vue.createElementVNode(
  4605. "view",
  4606. {
  4607. class: vue.normalizeClass(["filter-item", { "active": _ctx.activeDropdown === 2 }]),
  4608. onClick: _cache[2] || (_cache[2] = ($event) => _ctx.toggleDropdown(2))
  4609. },
  4610. [
  4611. vue.createElementVNode(
  4612. "text",
  4613. {
  4614. class: vue.normalizeClass({ "active-text": _ctx.activeDropdown === 2 || _ctx.hasTimeFilter })
  4615. },
  4616. "服务时间",
  4617. 2
  4618. /* CLASS */
  4619. ),
  4620. vue.createElementVNode(
  4621. "view",
  4622. {
  4623. class: vue.normalizeClass(["triangle", _ctx.activeDropdown === 2 ? "up" : "down"])
  4624. },
  4625. null,
  4626. 2
  4627. /* CLASS */
  4628. )
  4629. ],
  4630. 2
  4631. /* CLASS */
  4632. )
  4633. ]),
  4634. _ctx.activeDropdown !== 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  4635. key: 0,
  4636. class: "dropdown-mask",
  4637. onClick: _cache[3] || (_cache[3] = (...args) => _ctx.closeDropdown && _ctx.closeDropdown(...args))
  4638. })) : vue.createCommentVNode("v-if", true),
  4639. _ctx.activeDropdown === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  4640. key: 1,
  4641. class: "dropdown-panel"
  4642. }, [
  4643. (vue.openBlock(true), vue.createElementBlock(
  4644. vue.Fragment,
  4645. null,
  4646. vue.renderList(_ctx.typeFilterOptions, (item, index) => {
  4647. return vue.openBlock(), vue.createElementBlock("view", {
  4648. class: vue.normalizeClass(["type-option", { "selected": _ctx.currentTypeFilterIdx === index }]),
  4649. key: index,
  4650. onClick: ($event) => _ctx.selectType(index)
  4651. }, [
  4652. vue.createElementVNode(
  4653. "text",
  4654. null,
  4655. vue.toDisplayString(item),
  4656. 1
  4657. /* TEXT */
  4658. )
  4659. ], 10, ["onClick"]);
  4660. }),
  4661. 128
  4662. /* KEYED_FRAGMENT */
  4663. ))
  4664. ])) : vue.createCommentVNode("v-if", true),
  4665. _ctx.activeDropdown === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  4666. key: 2,
  4667. class: "dropdown-panel calendar-panel"
  4668. }, [
  4669. vue.createElementVNode("view", { class: "custom-calendar-container" }, [
  4670. vue.createElementVNode("view", { class: "cal-header" }, [
  4671. vue.createElementVNode("text", {
  4672. class: "cal-nav-btn",
  4673. onClick: _cache[4] || (_cache[4] = (...args) => _ctx.prevMonth && _ctx.prevMonth(...args))
  4674. }, "‹"),
  4675. vue.createElementVNode(
  4676. "text",
  4677. { class: "cal-title" },
  4678. vue.toDisplayString(_ctx.currentMonth),
  4679. 1
  4680. /* TEXT */
  4681. ),
  4682. vue.createElementVNode("text", {
  4683. class: "cal-nav-btn",
  4684. onClick: _cache[5] || (_cache[5] = (...args) => _ctx.nextMonth && _ctx.nextMonth(...args))
  4685. }, "›")
  4686. ]),
  4687. vue.createElementVNode("view", { class: "cal-weekdays" }, [
  4688. (vue.openBlock(true), vue.createElementBlock(
  4689. vue.Fragment,
  4690. null,
  4691. vue.renderList(_ctx.weekDays, (wk, idx) => {
  4692. return vue.openBlock(), vue.createElementBlock(
  4693. "text",
  4694. {
  4695. key: idx,
  4696. class: "wk-item"
  4697. },
  4698. vue.toDisplayString(wk),
  4699. 1
  4700. /* TEXT */
  4701. );
  4702. }),
  4703. 128
  4704. /* KEYED_FRAGMENT */
  4705. ))
  4706. ]),
  4707. vue.createElementVNode("view", { class: "cal-body" }, [
  4708. (vue.openBlock(true), vue.createElementBlock(
  4709. vue.Fragment,
  4710. null,
  4711. vue.renderList(_ctx.calendarDays, (day, idx) => {
  4712. return vue.openBlock(), vue.createElementBlock("view", {
  4713. key: idx,
  4714. class: vue.normalizeClass(["cal-day-box", _ctx.getDateClass(day)]),
  4715. onClick: ($event) => _ctx.selectDateItem(day)
  4716. }, [
  4717. vue.createElementVNode(
  4718. "view",
  4719. { class: "cal-day-text" },
  4720. vue.toDisplayString(day),
  4721. 1
  4722. /* TEXT */
  4723. )
  4724. ], 10, ["onClick"]);
  4725. }),
  4726. 128
  4727. /* KEYED_FRAGMENT */
  4728. ))
  4729. ])
  4730. ]),
  4731. vue.createElementVNode("view", { class: "calendar-actions" }, [
  4732. vue.createElementVNode("button", {
  4733. class: "cal-btn reset",
  4734. onClick: _cache[6] || (_cache[6] = (...args) => _ctx.resetTimeFilter && _ctx.resetTimeFilter(...args))
  4735. }, "重置"),
  4736. vue.createElementVNode("button", {
  4737. class: "cal-btn confirm",
  4738. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.confirmTimeFilter && _ctx.confirmTimeFilter(...args))
  4739. }, "确定")
  4740. ])
  4741. ])) : vue.createCommentVNode("v-if", true)
  4742. ])
  4743. ]),
  4744. vue.createElementVNode("view", { class: "order-list" }, [
  4745. (vue.openBlock(true), vue.createElementBlock(
  4746. vue.Fragment,
  4747. null,
  4748. vue.renderList(_ctx.orderList, (item, index) => {
  4749. return vue.openBlock(), vue.createElementBlock("view", {
  4750. class: "order-card",
  4751. key: index,
  4752. onClick: ($event) => _ctx.goToDetail(item)
  4753. }, [
  4754. vue.createElementVNode("view", { class: "card-header" }, [
  4755. vue.createElementVNode("view", { class: "type-badge" }, [
  4756. vue.createElementVNode("image", {
  4757. class: "type-icon",
  4758. src: item.typeIcon
  4759. }, null, 8, ["src"]),
  4760. vue.createElementVNode(
  4761. "text",
  4762. { class: "type-text" },
  4763. vue.toDisplayString(item.typeText),
  4764. 1
  4765. /* TEXT */
  4766. )
  4767. ]),
  4768. vue.createElementVNode(
  4769. "text",
  4770. {
  4771. class: vue.normalizeClass(["status-badge", _ctx.getStatusClass(item)])
  4772. },
  4773. vue.toDisplayString(_ctx.getDisplayStatus(item)),
  4774. 3
  4775. /* TEXT, CLASS */
  4776. )
  4777. ]),
  4778. vue.createElementVNode("view", { class: "card-body" }, [
  4779. vue.createElementVNode("view", { class: "time-row" }, [
  4780. vue.createElementVNode("view", { class: "time-col" }, [
  4781. vue.createElementVNode(
  4782. "text",
  4783. { class: "label" },
  4784. vue.toDisplayString(item.timeLabel) + ":",
  4785. 1
  4786. /* TEXT */
  4787. ),
  4788. vue.createElementVNode(
  4789. "text",
  4790. { class: "value" },
  4791. vue.toDisplayString(item.time),
  4792. 1
  4793. /* TEXT */
  4794. )
  4795. ]),
  4796. vue.createElementVNode(
  4797. "text",
  4798. { class: "price" },
  4799. "¥" + vue.toDisplayString(item.price),
  4800. 1
  4801. /* TEXT */
  4802. )
  4803. ]),
  4804. vue.createElementVNode("view", { class: "pet-card" }, [
  4805. vue.createElementVNode("image", {
  4806. class: "pet-avatar",
  4807. src: item.petAvatarUrl || item.petAvatar,
  4808. mode: "aspectFill"
  4809. }, null, 8, ["src"]),
  4810. vue.createElementVNode("view", { class: "pet-info" }, [
  4811. vue.createElementVNode(
  4812. "text",
  4813. { class: "pet-name" },
  4814. vue.toDisplayString(item.petName),
  4815. 1
  4816. /* TEXT */
  4817. ),
  4818. vue.createElementVNode(
  4819. "text",
  4820. { class: "pet-breed" },
  4821. "品种: " + vue.toDisplayString(item.petBreed),
  4822. 1
  4823. /* TEXT */
  4824. )
  4825. ])
  4826. ]),
  4827. vue.createElementVNode("view", { class: "route-info" }, [
  4828. item.type === 1 ? (vue.openBlock(), vue.createElementBlock(
  4829. vue.Fragment,
  4830. { key: 0 },
  4831. [
  4832. vue.createElementVNode("view", {
  4833. class: "route-item",
  4834. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "start"), ["stop"])
  4835. }, [
  4836. vue.createElementVNode("view", { class: "icon-circle start" }, "起"),
  4837. vue.createElementVNode("view", { class: "route-line-vertical" }),
  4838. vue.createElementVNode("view", { class: "address-box" }, [
  4839. vue.createElementVNode(
  4840. "text",
  4841. { class: "addr-title" },
  4842. vue.toDisplayString(item.startLocation),
  4843. 1
  4844. /* TEXT */
  4845. ),
  4846. vue.createElementVNode(
  4847. "text",
  4848. { class: "addr-desc" },
  4849. vue.toDisplayString(item.startAddress),
  4850. 1
  4851. /* TEXT */
  4852. )
  4853. ]),
  4854. vue.createElementVNode("image", {
  4855. class: "nav-arrow",
  4856. src: _imports_3$2,
  4857. style: { "flex-shrink": "0", "align-self": "center" }
  4858. })
  4859. ], 8, ["onClick"]),
  4860. vue.createElementVNode("view", {
  4861. class: "route-item",
  4862. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "end"), ["stop"])
  4863. }, [
  4864. vue.createElementVNode("view", { class: "icon-circle end" }, "终"),
  4865. vue.createElementVNode("view", { class: "address-box" }, [
  4866. vue.createElementVNode(
  4867. "text",
  4868. { class: "addr-title" },
  4869. vue.toDisplayString(item.endLocation),
  4870. 1
  4871. /* TEXT */
  4872. ),
  4873. vue.createElementVNode(
  4874. "text",
  4875. { class: "addr-desc" },
  4876. vue.toDisplayString(item.endAddress),
  4877. 1
  4878. /* TEXT */
  4879. )
  4880. ]),
  4881. vue.createElementVNode("image", {
  4882. class: "nav-arrow",
  4883. src: _imports_3$2,
  4884. style: { "flex-shrink": "0", "align-self": "center" }
  4885. })
  4886. ], 8, ["onClick"])
  4887. ],
  4888. 64
  4889. /* STABLE_FRAGMENT */
  4890. )) : (vue.openBlock(), vue.createElementBlock(
  4891. vue.Fragment,
  4892. { key: 1 },
  4893. [
  4894. vue.createElementVNode("view", {
  4895. class: "route-item",
  4896. onClick: vue.withModifiers(($event) => _ctx.openNavigation(item, "end"), ["stop"])
  4897. }, [
  4898. vue.createElementVNode("view", { class: "icon-circle service" }, "服"),
  4899. vue.createElementVNode("view", { class: "address-box" }, [
  4900. vue.createElementVNode(
  4901. "text",
  4902. { class: "addr-title" },
  4903. vue.toDisplayString(item.endLocation),
  4904. 1
  4905. /* TEXT */
  4906. ),
  4907. vue.createElementVNode(
  4908. "text",
  4909. { class: "addr-desc" },
  4910. vue.toDisplayString(item.endAddress),
  4911. 1
  4912. /* TEXT */
  4913. )
  4914. ]),
  4915. vue.createElementVNode("image", {
  4916. class: "nav-arrow",
  4917. src: _imports_3$2,
  4918. style: { "flex-shrink": "0", "align-self": "center" }
  4919. })
  4920. ], 8, ["onClick"]),
  4921. item.serviceContent ? (vue.openBlock(), vue.createElementBlock("view", {
  4922. key: 0,
  4923. class: "service-content"
  4924. }, [
  4925. vue.createElementVNode("text", { class: "content-label" }, "服务内容:"),
  4926. vue.createElementVNode(
  4927. "text",
  4928. null,
  4929. vue.toDisplayString(item.serviceContent),
  4930. 1
  4931. /* TEXT */
  4932. )
  4933. ])) : vue.createCommentVNode("v-if", true)
  4934. ],
  4935. 64
  4936. /* STABLE_FRAGMENT */
  4937. ))
  4938. ]),
  4939. item.remark ? (vue.openBlock(), vue.createElementBlock("view", {
  4940. key: 0,
  4941. class: "remark-box"
  4942. }, [
  4943. vue.createElementVNode(
  4944. "text",
  4945. null,
  4946. "备注:" + vue.toDisplayString(item.remark),
  4947. 1
  4948. /* TEXT */
  4949. )
  4950. ])) : vue.createCommentVNode("v-if", true)
  4951. ]),
  4952. ["接单", "到达", "出发", "开始", "送达", "结束"].includes(item.statusText) ? (vue.openBlock(), vue.createElementBlock("view", {
  4953. key: 0,
  4954. class: "action-btns"
  4955. }, [
  4956. vue.createElementVNode("view", { class: "action-left" }, [
  4957. vue.createElementVNode("button", {
  4958. class: "btn normal",
  4959. onClick: vue.withModifiers(($event) => _ctx.doCall("customer", item), ["stop"])
  4960. }, "拨号", 8, ["onClick"])
  4961. ]),
  4962. vue.createElementVNode("view", { class: "action-right" }, [
  4963. item.status === 2 ? (vue.openBlock(), vue.createElementBlock("button", {
  4964. key: 0,
  4965. class: "btn normal danger",
  4966. onClick: vue.withModifiers(($event) => _ctx.handleCancelOrder(item), ["stop"])
  4967. }, "取消", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
  4968. vue.createElementVNode("button", {
  4969. class: "btn normal",
  4970. onClick: vue.withModifiers(($event) => _ctx.reportAbnormal(item), ["stop"])
  4971. }, "异常上报", 8, ["onClick"]),
  4972. vue.createElementVNode("button", {
  4973. class: "btn primary",
  4974. onClick: vue.withModifiers(($event) => _ctx.mainAction(item), ["stop"])
  4975. }, "打卡", 8, ["onClick"])
  4976. ])
  4977. ])) : vue.createCommentVNode("v-if", true)
  4978. ], 8, ["onClick"]);
  4979. }),
  4980. 128
  4981. /* KEYED_FRAGMENT */
  4982. )),
  4983. vue.createElementVNode("view", { class: "loading-text" }, "已加载完"),
  4984. vue.createElementVNode("view", { style: { "height": "160rpx" } })
  4985. ]),
  4986. _ctx.activeCallItem ? (vue.openBlock(), vue.createElementBlock("view", {
  4987. key: 0,
  4988. class: "call-mask",
  4989. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.closeCallMenu && _ctx.closeCallMenu(...args))
  4990. })) : vue.createCommentVNode("v-if", true)
  4991. ]),
  4992. _ctx.showPetModal ? (vue.openBlock(), vue.createElementBlock("view", {
  4993. key: 0,
  4994. class: "pet-modal-mask",
  4995. onClick: _cache[12] || (_cache[12] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  4996. }, [
  4997. vue.createElementVNode("view", {
  4998. class: "pet-modal-content",
  4999. onClick: _cache[11] || (_cache[11] = vue.withModifiers(() => {
  5000. }, ["stop"]))
  5001. }, [
  5002. vue.createElementVNode("view", { class: "pet-modal-header" }, [
  5003. vue.createElementVNode("text", { class: "pet-modal-title" }, "宠物档案"),
  5004. vue.createElementVNode("view", { class: "pm-header-actions" }, [
  5005. vue.createElementVNode("view", {
  5006. class: "pm-remark-btn",
  5007. onClick: _cache[9] || (_cache[9] = (...args) => _ctx.openRemarkInput && _ctx.openRemarkInput(...args))
  5008. }, "备注"),
  5009. vue.createElementVNode("view", {
  5010. class: "close-icon-btn",
  5011. onClick: _cache[10] || (_cache[10] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  5012. }, "×")
  5013. ])
  5014. ]),
  5015. vue.createElementVNode("scroll-view", {
  5016. "scroll-y": "",
  5017. class: "pet-modal-scroll"
  5018. }, [
  5019. vue.createElementVNode("view", { class: "pet-base-info" }, [
  5020. vue.createElementVNode("image", {
  5021. class: "pm-avatar",
  5022. src: _ctx.currentPetInfo.petAvatar,
  5023. mode: "aspectFill"
  5024. }, null, 8, ["src"]),
  5025. vue.createElementVNode("view", { class: "pm-info-text" }, [
  5026. vue.createElementVNode("view", { class: "pm-name-row" }, [
  5027. vue.createElementVNode(
  5028. "text",
  5029. { class: "pm-name" },
  5030. vue.toDisplayString(_ctx.currentPetInfo.petName),
  5031. 1
  5032. /* TEXT */
  5033. ),
  5034. _ctx.currentPetInfo.petGender === "M" ? (vue.openBlock(), vue.createElementBlock("view", {
  5035. key: 0,
  5036. class: "pm-gender"
  5037. }, [
  5038. vue.createElementVNode("text", { class: "gender-icon" }, "♂"),
  5039. vue.createElementVNode("text", null, "公")
  5040. ])) : _ctx.currentPetInfo.petGender === "F" ? (vue.openBlock(), vue.createElementBlock("view", {
  5041. key: 1,
  5042. class: "pm-gender female"
  5043. }, [
  5044. vue.createElementVNode("text", { class: "gender-icon" }, "♀"),
  5045. vue.createElementVNode("text", null, "母")
  5046. ])) : vue.createCommentVNode("v-if", true)
  5047. ]),
  5048. vue.createElementVNode(
  5049. "text",
  5050. { class: "pm-breed" },
  5051. "品种:" + vue.toDisplayString(_ctx.currentPetInfo.petBreed),
  5052. 1
  5053. /* TEXT */
  5054. )
  5055. ])
  5056. ]),
  5057. vue.createElementVNode("view", { class: "pm-detail-grid" }, [
  5058. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  5059. vue.createElementVNode("text", { class: "pm-label" }, "年龄"),
  5060. vue.createElementVNode(
  5061. "text",
  5062. { class: "pm-val" },
  5063. vue.toDisplayString(_ctx.currentPetInfo.petAge || "未知"),
  5064. 1
  5065. /* TEXT */
  5066. )
  5067. ]),
  5068. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  5069. vue.createElementVNode("text", { class: "pm-label" }, "体重"),
  5070. vue.createElementVNode(
  5071. "text",
  5072. { class: "pm-val" },
  5073. vue.toDisplayString(_ctx.currentPetInfo.petWeight || "未知"),
  5074. 1
  5075. /* TEXT */
  5076. )
  5077. ]),
  5078. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  5079. vue.createElementVNode("text", { class: "pm-label" }, "性格"),
  5080. vue.createElementVNode(
  5081. "text",
  5082. { class: "pm-val" },
  5083. vue.toDisplayString(_ctx.currentPetInfo.petPersonality || "无"),
  5084. 1
  5085. /* TEXT */
  5086. )
  5087. ]),
  5088. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  5089. vue.createElementVNode("text", { class: "pm-label" }, "爱好"),
  5090. vue.createElementVNode(
  5091. "text",
  5092. { class: "pm-val" },
  5093. vue.toDisplayString(_ctx.currentPetInfo.petHobby || "无"),
  5094. 1
  5095. /* TEXT */
  5096. )
  5097. ]),
  5098. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  5099. vue.createElementVNode("text", { class: "pm-label" }, "备注"),
  5100. vue.createElementVNode(
  5101. "text",
  5102. { class: "pm-val" },
  5103. vue.toDisplayString(_ctx.currentPetInfo.petRemark || "无特殊过敏史"),
  5104. 1
  5105. /* TEXT */
  5106. )
  5107. ])
  5108. ]),
  5109. _ctx.currentPetInfo.petTags && _ctx.currentPetInfo.petTags.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  5110. key: 0,
  5111. class: "pm-tags"
  5112. }, [
  5113. (vue.openBlock(true), vue.createElementBlock(
  5114. vue.Fragment,
  5115. null,
  5116. vue.renderList(_ctx.currentPetInfo.petTags, (tag, index) => {
  5117. return vue.openBlock(), vue.createElementBlock(
  5118. "view",
  5119. {
  5120. class: "pm-tag",
  5121. key: index
  5122. },
  5123. vue.toDisplayString(tag),
  5124. 1
  5125. /* TEXT */
  5126. );
  5127. }),
  5128. 128
  5129. /* KEYED_FRAGMENT */
  5130. ))
  5131. ])) : vue.createCommentVNode("v-if", true),
  5132. vue.createElementVNode("view", { class: "pm-section-title" }, [
  5133. vue.createElementVNode("view", { class: "orange-bar" }),
  5134. vue.createElementVNode("text", null, "备注日志")
  5135. ]),
  5136. vue.createElementVNode("view", { class: "pm-log-list" }, [
  5137. (vue.openBlock(true), vue.createElementBlock(
  5138. vue.Fragment,
  5139. null,
  5140. vue.renderList(_ctx.currentPetInfo.petLogs, (log, lIndex) => {
  5141. return vue.openBlock(), vue.createElementBlock("view", {
  5142. class: "pm-log-item",
  5143. key: lIndex
  5144. }, [
  5145. vue.createElementVNode(
  5146. "text",
  5147. { class: "pm-log-date" },
  5148. vue.toDisplayString(log.date),
  5149. 1
  5150. /* TEXT */
  5151. ),
  5152. vue.createElementVNode(
  5153. "text",
  5154. { class: "pm-log-text" },
  5155. vue.toDisplayString(log.content),
  5156. 1
  5157. /* TEXT */
  5158. ),
  5159. vue.createElementVNode(
  5160. "text",
  5161. { class: "pm-log-recorder" },
  5162. vue.toDisplayString(log.recorder === "系统记录" ? "" : "记录人: ") + vue.toDisplayString(log.recorder),
  5163. 1
  5164. /* TEXT */
  5165. )
  5166. ]);
  5167. }),
  5168. 128
  5169. /* KEYED_FRAGMENT */
  5170. ))
  5171. ]),
  5172. vue.createElementVNode("view", { style: { "height": "30rpx" } })
  5173. ])
  5174. ])
  5175. ])) : vue.createCommentVNode("v-if", true),
  5176. _ctx.showRemarkInput ? (vue.openBlock(), vue.createElementBlock("view", {
  5177. key: 1,
  5178. class: "remark-mask",
  5179. onClick: _cache[17] || (_cache[17] = (...args) => _ctx.closeRemarkInput && _ctx.closeRemarkInput(...args))
  5180. }, [
  5181. vue.createElementVNode("view", {
  5182. class: "remark-sheet",
  5183. onClick: _cache[16] || (_cache[16] = vue.withModifiers(() => {
  5184. }, ["stop"]))
  5185. }, [
  5186. vue.createElementVNode("view", { class: "remark-sheet-header" }, [
  5187. vue.createElementVNode("text", { class: "remark-sheet-title" }, "添加备注"),
  5188. vue.createElementVNode("view", {
  5189. class: "close-icon-btn",
  5190. onClick: _cache[13] || (_cache[13] = (...args) => _ctx.closeRemarkInput && _ctx.closeRemarkInput(...args))
  5191. }, "×")
  5192. ]),
  5193. vue.withDirectives(vue.createElementVNode(
  5194. "textarea",
  5195. {
  5196. class: "remark-textarea",
  5197. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => _ctx.remarkText = $event),
  5198. placeholder: "请输入备注内容...",
  5199. maxlength: "500",
  5200. "auto-height": ""
  5201. },
  5202. null,
  5203. 512
  5204. /* NEED_PATCH */
  5205. ), [
  5206. [vue.vModelText, _ctx.remarkText]
  5207. ]),
  5208. vue.createElementVNode("view", {
  5209. class: "remark-submit-btn",
  5210. onClick: _cache[15] || (_cache[15] = (...args) => _ctx.submitRemark && _ctx.submitRemark(...args))
  5211. }, "提交备注")
  5212. ])
  5213. ])) : vue.createCommentVNode("v-if", true),
  5214. _ctx.showNavModal ? (vue.openBlock(), vue.createElementBlock("view", {
  5215. key: 2,
  5216. class: "nav-modal-mask",
  5217. onClick: _cache[23] || (_cache[23] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  5218. }, [
  5219. vue.createElementVNode("view", {
  5220. class: "nav-action-sheet",
  5221. onClick: _cache[22] || (_cache[22] = vue.withModifiers(() => {
  5222. }, ["stop"]))
  5223. }, [
  5224. vue.createElementVNode("view", { class: "nav-sheet-title" }, "选择地图进行导航"),
  5225. vue.createElementVNode("view", {
  5226. class: "nav-sheet-item",
  5227. onClick: _cache[18] || (_cache[18] = ($event) => _ctx.chooseMap("高德"))
  5228. }, "高德地图"),
  5229. vue.createElementVNode("view", {
  5230. class: "nav-sheet-item",
  5231. onClick: _cache[19] || (_cache[19] = ($event) => _ctx.chooseMap("腾讯"))
  5232. }, "腾讯地图"),
  5233. vue.createElementVNode("view", {
  5234. class: "nav-sheet-item",
  5235. onClick: _cache[20] || (_cache[20] = ($event) => _ctx.chooseMap("百度"))
  5236. }, "百度地图"),
  5237. vue.createElementVNode("view", { class: "nav-sheet-gap" }),
  5238. vue.createElementVNode("view", {
  5239. class: "nav-sheet-item cancel",
  5240. onClick: _cache[21] || (_cache[21] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  5241. }, "取消")
  5242. ])
  5243. ])) : vue.createCommentVNode("v-if", true),
  5244. vue.createVNode(_component_custom_tabbar, { currentPath: "pages/orders/index" })
  5245. ],
  5246. 64
  5247. /* STABLE_FRAGMENT */
  5248. );
  5249. }
  5250. const PagesOrdersIndex = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/orders/index.vue"]]);
  5251. function getOrderStats() {
  5252. return request({
  5253. url: "/order/subOrderLog/count",
  5254. method: "GET"
  5255. });
  5256. }
  5257. function getOrderLogs(orderId) {
  5258. return request({
  5259. url: `/order/subOrderLog/list?orderId=${orderId}`,
  5260. method: "GET"
  5261. });
  5262. }
  5263. function uploadAnamaly(data) {
  5264. return request({
  5265. url: "/fulfiller/anamaly/upload",
  5266. method: "POST",
  5267. data
  5268. });
  5269. }
  5270. function getAnomalyList(orderId) {
  5271. return request({
  5272. url: `/fulfiller/anamaly/listOnOrder?orderId=${orderId}`,
  5273. method: "GET"
  5274. });
  5275. }
  5276. function getDictDataByType(dictType) {
  5277. return request({
  5278. url: `/system/dict/data/type/${dictType}`,
  5279. method: "GET"
  5280. });
  5281. }
  5282. function getPetDetail(id) {
  5283. return request({
  5284. url: `/archieves/pet/${id}`,
  5285. method: "GET"
  5286. });
  5287. }
  5288. function submitPetRemark(data) {
  5289. return request({
  5290. url: "/archieves/pet/remark",
  5291. method: "POST",
  5292. data
  5293. });
  5294. }
  5295. function listChangeLog(params) {
  5296. return request({
  5297. url: "/archieves/changeLog/listAll",
  5298. method: "GET",
  5299. data: params
  5300. });
  5301. }
  5302. const logic$1 = {
  5303. data() {
  5304. return {
  5305. orderId: null,
  5306. pageLoading: true,
  5307. // 页面数据加载中
  5308. orderType: 1,
  5309. orderStatus: 2,
  5310. serviceId: null,
  5311. // 当前订单的服务类型ID
  5312. serviceMode: null,
  5313. // 当前订单的服务模式 (0: 喂遛/洗护, 1: 接送)
  5314. petId: null,
  5315. // 当前订单关联的宠物ID
  5316. petDetail: null,
  5317. // 宠物档案详情
  5318. // 从后端 clockInRemark 解析出的打卡步骤列表
  5319. // 格式: [{step:1, title:'到达打卡', remark:'照片视频二选一即可'}, ...]
  5320. clockInSteps: [],
  5321. // 当前应执行的打卡信息(从 clockInSteps 中取出)
  5322. currentClockIn: null,
  5323. currentStep: 0,
  5324. orderDetail: {
  5325. type: 1,
  5326. price: "0.00",
  5327. timeLabel: "服务时间",
  5328. time: "",
  5329. petAvatar: "/static/dog.png",
  5330. petName: "",
  5331. petBreed: "",
  5332. serviceTag: "",
  5333. startLocation: "",
  5334. startAddress: "",
  5335. endAddress: "",
  5336. customerPhone: "",
  5337. serviceContent: "",
  5338. remark: "",
  5339. orderNo: "",
  5340. createTime: "",
  5341. serviceName: "",
  5342. // 服务类型名称
  5343. progressLogs: [],
  5344. nursingSummary: ""
  5345. // 宠护小结
  5346. },
  5347. serviceList: [],
  5348. showPetModal: false,
  5349. currentPetInfo: {},
  5350. showNavModal: false,
  5351. navTargetPointType: "",
  5352. showUploadModal: false,
  5353. modalMediaList: [],
  5354. modalRemark: "",
  5355. showSumModal: false,
  5356. sumContent: "",
  5357. sumDate: "",
  5358. sumSigner: "未知",
  5359. showPetRemarkInput: false,
  5360. petRemarkText: "",
  5361. showAnomalyModal: false,
  5362. anomalyList: [],
  5363. anomalyTypeDict: [],
  5364. // 媒体预览相关
  5365. videoPlayerShow: false,
  5366. videoPlayerUrl: ""
  5367. };
  5368. },
  5369. computed: {
  5370. // 从 clockInSteps 中提取 title 数组作为打卡步骤名(内部逻辑用)
  5371. steps() {
  5372. if (this.clockInSteps.length > 0) {
  5373. return this.clockInSteps.map((s) => s.title);
  5374. }
  5375. return this.orderType === 1 ? ["到达打卡", "确认出发", "送达打卡"] : ["到达打卡", "开始服务", "服务结束"];
  5376. },
  5377. // 顶部进度条展示用:已接单 -> 各打卡步骤 -> 订单完成
  5378. progressSteps() {
  5379. return ["已接单", ...this.steps, "订单完成"];
  5380. },
  5381. // 进度条当前激活索引(= currentStep + 1,因为首位是"已接单")
  5382. progressIndex() {
  5383. return this.currentStep + 1;
  5384. },
  5385. displayStatusText() {
  5386. if (this.currentStep >= this.steps.length)
  5387. return "已完成";
  5388. if (this.currentStep > 0) {
  5389. return this.orderType === 1 ? "配送中" : "服务中";
  5390. }
  5391. return this.orderType === 1 ? "待接送" : "待服务";
  5392. },
  5393. currentStatusText() {
  5394. return this.currentStep >= this.steps.length ? "已完成" : this.steps[this.currentStep];
  5395. },
  5396. // 按钮文本:使用 clockInSteps 中对应步骤的 title
  5397. currentTaskTitle() {
  5398. if (this.currentStep >= this.steps.length)
  5399. return "订单已完成";
  5400. if (this.currentClockIn) {
  5401. return this.currentClockIn.title;
  5402. }
  5403. return this.steps[this.currentStep] || "打卡";
  5404. },
  5405. // 任务描述小字:使用 clockInSteps 中对应步骤的 remark
  5406. currentTaskDesc() {
  5407. if (this.currentStep >= this.steps.length)
  5408. return "感谢您的服务,请注意休息";
  5409. if (this.currentClockIn && this.currentClockIn.remark) {
  5410. return this.currentClockIn.remark;
  5411. }
  5412. return "请按要求提交照片或视频及备注";
  5413. }
  5414. },
  5415. async onLoad(options) {
  5416. if (options.id) {
  5417. this.orderId = options.id;
  5418. }
  5419. this.pageLoading = true;
  5420. reportGps(true).catch((e) => formatAppLog("log", "at pages/orders/detail-logic.js:140", "Init GPS check skipped", e));
  5421. try {
  5422. await this.loadAnomalyTypeDict();
  5423. await this.loadServiceList();
  5424. await this.loadOrderDetail();
  5425. } finally {
  5426. this.pageLoading = false;
  5427. }
  5428. },
  5429. methods: {
  5430. async loadServiceList() {
  5431. try {
  5432. const res = await listAllService();
  5433. this.serviceList = res.data || [];
  5434. } catch (err) {
  5435. formatAppLog("error", "at pages/orders/detail-logic.js:159", "获取服务类型失败:", err);
  5436. }
  5437. },
  5438. /**
  5439. * 根据服务类型ID获取服务详情,解析 clockInRemark 为打卡步骤
  5440. */
  5441. /**
  5442. * 基于已加载的 serviceList 进行前端匹配,解析 clockInRemark 为打卡步骤
  5443. */
  5444. loadServiceDetail(serviceId) {
  5445. formatAppLog("log", "at pages/orders/detail-logic.js:169", "前端匹配服务详情, ID:", serviceId);
  5446. const serviceInfo = (this.serviceList || []).find((s) => s.id === serviceId);
  5447. formatAppLog("log", "at pages/orders/detail-logic.js:171", "匹配到的服务信息:", serviceInfo);
  5448. if (serviceInfo) {
  5449. this.serviceMode = serviceInfo.mode;
  5450. this.orderDetail.serviceName = serviceInfo.name;
  5451. formatAppLog("log", "at pages/orders/detail-logic.js:175", "当前服务模式(mode):", this.serviceMode);
  5452. if (serviceInfo.clockInRemark) {
  5453. try {
  5454. const parsed = JSON.parse(serviceInfo.clockInRemark);
  5455. if (Array.isArray(parsed) && parsed.length > 0) {
  5456. this.clockInSteps = parsed;
  5457. formatAppLog("log", "at pages/orders/detail-logic.js:181", "解析打卡步骤:", this.clockInSteps);
  5458. }
  5459. } catch (parseErr) {
  5460. formatAppLog("error", "at pages/orders/detail-logic.js:184", "解析 clockInRemark 失败:", parseErr);
  5461. }
  5462. }
  5463. }
  5464. },
  5465. async loadOrderDetail() {
  5466. if (!this.orderId) {
  5467. formatAppLog("log", "at pages/orders/detail-logic.js:191", "订单ID缺失");
  5468. uni.showToast({ title: "订单ID缺失", icon: "none" });
  5469. return;
  5470. }
  5471. try {
  5472. formatAppLog("log", "at pages/orders/detail-logic.js:196", "请求订单详情,ID:", this.orderId);
  5473. const res = await getOrderInfo(this.orderId);
  5474. formatAppLog("log", "at pages/orders/detail-logic.js:198", "订单详情响应:", res);
  5475. const order = res.data;
  5476. if (!order) {
  5477. formatAppLog("log", "at pages/orders/detail-logic.js:201", "订单数据为空");
  5478. uni.showToast({ title: "订单不存在", icon: "none" });
  5479. return;
  5480. }
  5481. formatAppLog("log", "at pages/orders/detail-logic.js:205", "订单数据:", order);
  5482. this.serviceId = order.service;
  5483. this.petId = order.usrPet || null;
  5484. this.transformOrderData(order);
  5485. formatAppLog("log", "at pages/orders/detail-logic.js:209", "解析出的 serviceId:", this.serviceId);
  5486. if (this.serviceId) {
  5487. this.loadServiceDetail(this.serviceId);
  5488. } else {
  5489. formatAppLog("warn", "at pages/orders/detail-logic.js:215", "订单中未找到 service 字段,无法加载服务步骤");
  5490. }
  5491. if (this.petId) {
  5492. await this.loadPetDetail(this.petId);
  5493. }
  5494. await this.loadOrderLogs();
  5495. } catch (err) {
  5496. formatAppLog("error", "at pages/orders/detail-logic.js:226", "获取订单详情失败:", err);
  5497. uni.showToast({ title: "加载失败", icon: "none" });
  5498. }
  5499. },
  5500. async loadOrderLogs() {
  5501. try {
  5502. const res = await getOrderLogs(this.orderId);
  5503. const logs = res.data || [];
  5504. formatAppLog("log", "at pages/orders/detail-logic.js:234", "订单日志:", logs);
  5505. const progressLogs = logs.filter((log) => log.logType === 1);
  5506. this.orderDetail.progressLogs = progressLogs.map((log) => ({
  5507. status: log.title || "",
  5508. time: log.createTime || "",
  5509. medias: log.photoUrls || [],
  5510. remark: log.content || ""
  5511. }));
  5512. const validLogs = logs.filter((log) => log.logType === 1 && log.step !== void 0 && log.step !== null).sort((a, b) => new Date(b.createTime).getTime() - new Date(a.createTime).getTime());
  5513. if (validLogs.length > 0) {
  5514. const latestLog = validLogs[0];
  5515. const latestStep = latestLog.step;
  5516. formatAppLog("log", "at pages/orders/detail-logic.js:253", "最新打卡日志 step:", latestStep);
  5517. const stepIndex = this.clockInSteps.findIndex((s) => s.step === latestStep);
  5518. if (stepIndex >= 0) {
  5519. this.currentStep = stepIndex + 1;
  5520. } else {
  5521. this.currentStep = Number(latestStep);
  5522. }
  5523. } else {
  5524. this.currentStep = 0;
  5525. }
  5526. this.updateCurrentClockIn();
  5527. formatAppLog("log", "at pages/orders/detail-logic.js:269", "根据最新日志推算的当前步骤:", this.currentStep, "当前打卡信息:", this.currentClockIn);
  5528. } catch (err) {
  5529. formatAppLog("error", "at pages/orders/detail-logic.js:271", "获取订单日志失败:", err);
  5530. }
  5531. },
  5532. /**
  5533. * 根据 currentStep 更新当前打卡信息
  5534. */
  5535. updateCurrentClockIn() {
  5536. if (this.currentStep < this.clockInSteps.length) {
  5537. this.currentClockIn = this.clockInSteps[this.currentStep];
  5538. } else {
  5539. this.currentClockIn = null;
  5540. }
  5541. },
  5542. transformOrderData(order) {
  5543. const mode = order.mode || 0;
  5544. const isRoundTrip = mode === 1;
  5545. this.orderType = isRoundTrip ? 1 : 2;
  5546. this.orderStatus = order.status || 2;
  5547. this.orderDetail = {
  5548. type: this.orderType,
  5549. price: (order.price / 100).toFixed(2),
  5550. timeLabel: isRoundTrip ? "取货时间" : "服务时间",
  5551. time: order.serviceTime || "",
  5552. petAvatar: "/static/dog.png",
  5553. petName: order.petName || order.contact || "",
  5554. petBreed: order.breed || "",
  5555. serviceTag: order.groupPurchasePackageName || "",
  5556. startLocation: order.fromAddress || "暂无起点",
  5557. startAddress: order.fromAddress || "",
  5558. fromAddress: order.fromAddress || "",
  5559. fromLat: order.fromLat,
  5560. fromLng: order.fromLng,
  5561. endLocation: (order.contact || "") + " " + (order.contactPhoneNumber || ""),
  5562. endAddress: order.toAddress || "",
  5563. toAddress: order.toAddress || "",
  5564. toLat: order.toLat,
  5565. toLng: order.toLng,
  5566. customerPhone: order.contactPhoneNumber || "",
  5567. ownerName: order.contact || "",
  5568. // 宠主姓名(默认使用客户姓名)
  5569. serviceContent: "",
  5570. remark: "",
  5571. orderNo: order.code || "T" + order.id,
  5572. createTime: order.serviceTime || "",
  5573. nursingSummary: order.nursingSummary || "",
  5574. fulfillerName: order.fulfillerName || "",
  5575. // 履约者/护宠师姓名
  5576. progressLogs: [
  5577. { status: "您已接单", time: order.serviceTime || "" }
  5578. ]
  5579. };
  5580. if (this.orderDetail.fulfillerName) {
  5581. this.sumSigner = this.orderDetail.fulfillerName;
  5582. }
  5583. },
  5584. /**
  5585. * 根据宠物ID获取宠物档案详情
  5586. */
  5587. async loadPetDetail(petId) {
  5588. try {
  5589. const res = await getPetDetail(petId);
  5590. const pet = res.data;
  5591. if (pet) {
  5592. this.petDetail = pet;
  5593. this.orderDetail.petAvatar = pet.avatarUrl || "/static/dog.png";
  5594. this.orderDetail.petName = pet.name || this.orderDetail.petName;
  5595. this.orderDetail.petBreed = pet.breed || this.orderDetail.petBreed;
  5596. this.orderDetail.ownerName = pet.ownerName || this.orderDetail.ownerName;
  5597. formatAppLog("log", "at pages/orders/detail-logic.js:342", "宠物档案:", pet);
  5598. }
  5599. } catch (err) {
  5600. formatAppLog("error", "at pages/orders/detail-logic.js:345", "获取宠物档案失败:", err);
  5601. }
  5602. },
  5603. /**
  5604. * 加载异常记录列表
  5605. */
  5606. async loadAnomalyList() {
  5607. if (!this.orderId)
  5608. return;
  5609. try {
  5610. const res = await getAnomalyList(this.orderId);
  5611. const list = res.data || [];
  5612. this.anomalyList = list.map((item) => {
  5613. const dict = this.anomalyTypeDict.find((d) => d.value === item.type);
  5614. return {
  5615. ...item,
  5616. typeLabel: dict ? dict.label : item.type,
  5617. // 确保有图片数组供展示,如果后端没返 photoUrls,尝试兼容
  5618. photoUrls: item.photoUrls || []
  5619. };
  5620. });
  5621. } catch (err) {
  5622. formatAppLog("error", "at pages/orders/detail-logic.js:368", "获取异常列表失败:", err);
  5623. }
  5624. },
  5625. async loadAnomalyTypeDict() {
  5626. try {
  5627. const res = await getDictDataByType("flf_anamaly_type");
  5628. this.anomalyTypeDict = res.data.map((item) => ({
  5629. label: item.dictLabel,
  5630. value: item.dictValue
  5631. }));
  5632. } catch (err) {
  5633. formatAppLog("error", "at pages/orders/detail-logic.js:379", "获取异常字典失败:", err);
  5634. }
  5635. },
  5636. openAnomalyModal() {
  5637. this.showAnomalyModal = true;
  5638. this.loadAnomalyList();
  5639. },
  5640. closeAnomalyModal() {
  5641. this.showAnomalyModal = false;
  5642. },
  5643. getAnomalyStatusLabel(status) {
  5644. const map = {
  5645. 0: "待审核",
  5646. 1: "已通过",
  5647. 2: "已驳回"
  5648. };
  5649. return map[status] || "未知";
  5650. },
  5651. updateStepByStatus() {
  5652. if (this.orderStatus === 2) {
  5653. this.currentStep = 0;
  5654. } else if (this.orderStatus === 3) {
  5655. this.currentStep = 1;
  5656. } else if (this.orderStatus === 4) {
  5657. this.currentStep = this.steps.length - 1;
  5658. } else {
  5659. this.currentStep = 0;
  5660. }
  5661. },
  5662. showPetProfile() {
  5663. const pet = this.petDetail;
  5664. if (pet) {
  5665. this.currentPetInfo = {
  5666. petAvatar: pet.avatarUrl || "/static/dog.png",
  5667. petName: pet.name || "",
  5668. petBreed: pet.breed || "",
  5669. petGender: pet.gender === 1 ? "M" : pet.gender === 2 ? "F" : "",
  5670. petAge: pet.age ? pet.age + "岁" : "未知",
  5671. petWeight: pet.weight ? pet.weight + "kg" : "未知",
  5672. petPersonality: pet.personality || pet.cutePersonality || "无",
  5673. petHobby: "",
  5674. petRemark: pet.remark || "无",
  5675. petTags: (pet.tags || []).map((t) => t.name),
  5676. petLogs: [],
  5677. // 额外信息
  5678. petSize: pet.size || "",
  5679. petIsSterilized: pet.isSterilized,
  5680. petHealthStatus: pet.healthStatus || "",
  5681. petAllergies: pet.allergies || "",
  5682. petMedicalHistory: pet.medicalHistory || "",
  5683. petVaccineStatus: pet.vaccineStatus || "",
  5684. ownerName: pet.ownerName || "",
  5685. ownerPhone: pet.ownerPhone || ""
  5686. };
  5687. this.loadPetChangeLogs(pet.id);
  5688. } else {
  5689. this.currentPetInfo = {
  5690. ...this.orderDetail,
  5691. petGender: "",
  5692. petAge: "未知",
  5693. petWeight: "未知",
  5694. petPersonality: "无",
  5695. petHobby: "",
  5696. petRemark: "无",
  5697. petTags: [],
  5698. petLogs: []
  5699. };
  5700. }
  5701. this.showPetModal = true;
  5702. },
  5703. async loadPetChangeLogs(petId) {
  5704. if (!petId)
  5705. return;
  5706. try {
  5707. const res = await listChangeLog({
  5708. targetId: petId,
  5709. targetType: "pet"
  5710. });
  5711. const logs = res.data || [];
  5712. this.currentPetInfo.petLogs = logs.map((item) => ({
  5713. date: item.createTime || "",
  5714. content: item.content || "",
  5715. recorder: item.operatorName || "未知"
  5716. }));
  5717. } catch (err) {
  5718. formatAppLog("error", "at pages/orders/detail-logic.js:466", "获取宠物备注列表失败:", err);
  5719. }
  5720. },
  5721. closePetProfile() {
  5722. this.showPetModal = false;
  5723. },
  5724. openPetRemarkInput() {
  5725. this.petRemarkText = "";
  5726. this.showPetRemarkInput = true;
  5727. },
  5728. closePetRemarkInput() {
  5729. this.showPetRemarkInput = false;
  5730. },
  5731. async submitPetRemark() {
  5732. if (!this.petRemarkText.trim()) {
  5733. uni.showToast({ title: "备注内容不能为空", icon: "none" });
  5734. return;
  5735. }
  5736. if (!this.petId) {
  5737. uni.showToast({ title: "宠物信息缺失", icon: "none" });
  5738. return;
  5739. }
  5740. uni.showLoading({ title: "提交中...", mask: true });
  5741. try {
  5742. await submitPetRemark({
  5743. petId: this.petId,
  5744. content: this.petRemarkText
  5745. });
  5746. uni.hideLoading();
  5747. uni.showToast({ title: "备注已添加", icon: "success" });
  5748. this.closePetRemarkInput();
  5749. this.loadPetChangeLogs(this.petId);
  5750. } catch (err) {
  5751. uni.hideLoading();
  5752. formatAppLog("error", "at pages/orders/detail-logic.js:504", "提交宠物备注失败:", err);
  5753. }
  5754. },
  5755. goToAnomaly() {
  5756. uni.navigateTo({
  5757. url: "/pages/orders/anomaly?orderId=" + (this.orderId || "")
  5758. });
  5759. },
  5760. /**
  5761. * 拨打电话 (带授权引导)
  5762. */
  5763. callPhone() {
  5764. const phoneNum = this.orderDetail.customerPhone || "18900008451";
  5765. if (!phoneNum) {
  5766. uni.showToast({ title: "手机号不存在", icon: "none" });
  5767. return;
  5768. }
  5769. uni.showModal({
  5770. title: "拨号提示",
  5771. content: `系统将为您拨打手机号: ${phoneNum},请授予拨号权限以正常通话。`,
  5772. confirmText: "呼叫",
  5773. cancelText: "取消",
  5774. success: (res) => {
  5775. if (res.confirm) {
  5776. uni.makePhoneCall({
  5777. phoneNumber: phoneNum,
  5778. fail: (err) => {
  5779. formatAppLog("error", "at pages/orders/detail-logic.js:533", "拨号失败:", err);
  5780. uni.showToast({ title: "无法唤起拨号盘,请检查权限设置", icon: "none" });
  5781. }
  5782. });
  5783. }
  5784. }
  5785. });
  5786. },
  5787. openNavigation(type) {
  5788. this.navTargetPointType = type;
  5789. this.showNavModal = true;
  5790. },
  5791. closeNavModal() {
  5792. this.showNavModal = false;
  5793. },
  5794. chooseMap(mapType) {
  5795. let pointType = this.navTargetPointType;
  5796. let name = pointType === "start" ? this.orderDetail.fromAddress || "起点" : this.orderDetail.toAddress || "终点";
  5797. let address = pointType === "start" ? this.orderDetail.fromAddress || "起点地址" : this.orderDetail.toAddress || "终点地址";
  5798. let latitude = pointType === "start" ? Number(this.orderDetail.fromLat) : Number(this.orderDetail.toLat);
  5799. let longitude = pointType === "start" ? Number(this.orderDetail.fromLng) : Number(this.orderDetail.toLng);
  5800. this.showNavModal = false;
  5801. const navigateTo = (lat, lng, addrName, addrDesc) => {
  5802. uni.openLocation({
  5803. latitude: lat,
  5804. longitude: lng,
  5805. name: addrName,
  5806. address: addrDesc || "无法获取详细地址",
  5807. success: function() {
  5808. formatAppLog("log", "at pages/orders/detail-logic.js:567", "打开导航成功: " + mapType);
  5809. },
  5810. fail: function(err) {
  5811. formatAppLog("error", "at pages/orders/detail-logic.js:570", "打开导航失败:", err);
  5812. uni.showToast({ title: "打开地图失败", icon: "none" });
  5813. }
  5814. });
  5815. };
  5816. if (latitude && longitude && !isNaN(latitude) && !isNaN(longitude)) {
  5817. navigateTo(latitude, longitude, name, address);
  5818. } else {
  5819. uni.showLoading({ title: "获取当前位置...", mask: true });
  5820. reportGps(true).then((res) => {
  5821. uni.hideLoading();
  5822. navigateTo(res.latitude, res.longitude, name, address);
  5823. }).catch((err) => {
  5824. uni.hideLoading();
  5825. formatAppLog("error", "at pages/orders/detail-logic.js:588", "获取地理位置失败:", err);
  5826. });
  5827. }
  5828. },
  5829. openUploadModal() {
  5830. this.modalMediaList = [];
  5831. this.modalRemark = "";
  5832. this.showUploadModal = true;
  5833. },
  5834. closeUploadModal() {
  5835. this.showUploadModal = false;
  5836. },
  5837. handleConfirmUpload() {
  5838. formatAppLog("log", "at pages/orders/detail-logic.js:602", "handleConfirmUpload被调用");
  5839. this.confirmUploadModal();
  5840. },
  5841. async chooseModalMedia() {
  5842. formatAppLog("log", "at pages/orders/detail-logic.js:606", "chooseModalMedia被调用");
  5843. uni.chooseMedia({
  5844. count: 5 - this.modalMediaList.length,
  5845. mediaType: ["image", "video"],
  5846. sourceType: ["album", "camera"],
  5847. success: async (res) => {
  5848. formatAppLog("log", "at pages/orders/detail-logic.js:613", "选择媒体文件成功:", res.tempFiles);
  5849. uni.showLoading({ title: "上传中...", mask: true });
  5850. try {
  5851. for (const file of res.tempFiles) {
  5852. const filePath = file.tempFilePath;
  5853. const fileType = file.fileType;
  5854. formatAppLog("log", "at pages/orders/detail-logic.js:619", "开始上传文件:", filePath, "类型:", fileType);
  5855. const uploadRes = await uploadFile(filePath);
  5856. formatAppLog("log", "at pages/orders/detail-logic.js:622", "服务器响应:", uploadRes);
  5857. if (uploadRes.code === 200) {
  5858. this.modalMediaList.push({
  5859. url: uploadRes.data.url,
  5860. ossId: uploadRes.data.ossId,
  5861. localPath: filePath,
  5862. mediaType: fileType,
  5863. thumb: file.thumbTempFilePath
  5864. // 视频缩略图(如果有)
  5865. });
  5866. formatAppLog("log", "at pages/orders/detail-logic.js:632", "媒体文件添加成功");
  5867. }
  5868. }
  5869. uni.hideLoading();
  5870. uni.showToast({ title: "上传成功", icon: "success" });
  5871. } catch (err) {
  5872. uni.hideLoading();
  5873. formatAppLog("error", "at pages/orders/detail-logic.js:639", "上传失败详情:", err);
  5874. uni.showToast({ title: "上传失败", icon: "none" });
  5875. }
  5876. },
  5877. fail: (err) => {
  5878. formatAppLog("error", "at pages/orders/detail-logic.js:644", "选择媒体文件失败:", err);
  5879. }
  5880. });
  5881. },
  5882. removeModalMedia(index) {
  5883. this.modalMediaList.splice(index, 1);
  5884. },
  5885. getCurrentTime() {
  5886. const now = /* @__PURE__ */ new Date();
  5887. const y = now.getFullYear();
  5888. const m = String(now.getMonth() + 1).padStart(2, "0");
  5889. const d = String(now.getDate()).padStart(2, "0");
  5890. const h = String(now.getHours()).padStart(2, "0");
  5891. const min = String(now.getMinutes()).padStart(2, "0");
  5892. return `${y}/${m}/${d} ${h}:${min}`;
  5893. },
  5894. async confirmUploadModal() {
  5895. formatAppLog("log", "at pages/orders/detail-logic.js:662", "confirmUploadModal被调用,文件数量:", this.modalMediaList.length);
  5896. if (this.modalMediaList.length === 0) {
  5897. uni.showToast({ title: "请上传至少一张图片或视频", icon: "none" });
  5898. return;
  5899. }
  5900. try {
  5901. uni.showLoading({ title: "提交中..." });
  5902. const uploadedMedias = this.modalMediaList.map((item) => item.url);
  5903. const ossIds = this.modalMediaList.map((item) => item.ossId);
  5904. formatAppLog("log", "at pages/orders/detail-logic.js:673", "准备打卡,ossIds:", ossIds);
  5905. const clockInType = this.currentClockIn ? this.currentClockIn.step : this.currentStep + 1;
  5906. const clockInData = {
  5907. orderId: this.orderId,
  5908. photos: ossIds,
  5909. content: this.modalRemark || "",
  5910. step: clockInType,
  5911. title: this.currentTaskTitle,
  5912. startFlag: Number(clockInType) === 1,
  5913. endFlag: Number(this.currentStep) === this.steps.length - 1
  5914. };
  5915. formatAppLog("log", "at pages/orders/detail-logic.js:688", "打卡数据:", clockInData);
  5916. await clockIn(clockInData);
  5917. uni.hideLoading();
  5918. this.closeUploadModal();
  5919. uni.showToast({ title: "打卡成功", icon: "success" });
  5920. await this.loadOrderDetail();
  5921. } catch (err) {
  5922. uni.hideLoading();
  5923. formatAppLog("error", "at pages/orders/detail-logic.js:698", "打卡失败:", err);
  5924. uni.showToast({ title: "打卡失败,请重试", icon: "none" });
  5925. }
  5926. },
  5927. copyOrderNo() {
  5928. uni.setClipboardData({
  5929. data: this.orderDetail.orderNo,
  5930. success: () => {
  5931. uni.showToast({ title: "复制成功", icon: "none" });
  5932. }
  5933. });
  5934. },
  5935. openSumModal() {
  5936. let displayDate = "";
  5937. if (this.orderDetail.time) {
  5938. displayDate = this.orderDetail.time.split(" ")[0].replace(/-/g, "/");
  5939. } else {
  5940. const now = /* @__PURE__ */ new Date();
  5941. const y = now.getFullYear();
  5942. const m = String(now.getMonth() + 1).padStart(2, "0");
  5943. const d = String(now.getDate()).padStart(2, "0");
  5944. displayDate = `${y}/${m}/${d}`;
  5945. }
  5946. this.sumDate = displayDate;
  5947. if (this.orderDetail.nursingSummary) {
  5948. this.sumContent = this.orderDetail.nursingSummary;
  5949. } else if (!this.sumContent) {
  5950. this.sumContent = "1. 精神/身体状态:\n2. 进食/饮水:\n3. 排泤情况:\n4. 卫生情况:\n5. 互动情况:\n6. 特殊情况/备注:";
  5951. }
  5952. this.showSumModal = true;
  5953. },
  5954. closeSumModal() {
  5955. this.showSumModal = false;
  5956. },
  5957. async submitSumModal() {
  5958. if (!this.sumContent.trim()) {
  5959. uni.showToast({ title: "请填写服务内容", icon: "none" });
  5960. return;
  5961. }
  5962. uni.showLoading({ title: "提交中...", mask: true });
  5963. try {
  5964. const res = await submitNursingSummary({
  5965. orderId: this.orderId,
  5966. content: this.sumContent
  5967. });
  5968. uni.hideLoading();
  5969. if (res.code === 200) {
  5970. uni.showToast({ title: "小结已提交", icon: "success" });
  5971. this.closeSumModal();
  5972. await this.loadOrderDetail();
  5973. } else {
  5974. uni.showToast({ title: res.msg || "提交失败", icon: "none" });
  5975. }
  5976. } catch (err) {
  5977. uni.hideLoading();
  5978. formatAppLog("error", "at pages/orders/detail-logic.js:766", "提交宠护小结失败:", err);
  5979. uni.showToast({ title: "提交失败,请重试", icon: "none" });
  5980. }
  5981. },
  5982. /**
  5983. * 检查是否为视频
  5984. */
  5985. isVideo(url) {
  5986. if (!url)
  5987. return false;
  5988. const videoExts = [".mp4", ".mov", ".m4v", ".3gp", ".avi", ".wmv"];
  5989. const lowerUrl = url.toLowerCase();
  5990. return videoExts.some((ext) => lowerUrl.includes(ext));
  5991. },
  5992. /**
  5993. * 获取视频封面图 (第一帧)
  5994. * 兼容阿里云、腾讯云等主流 OSS
  5995. */
  5996. getVideoPoster(url) {
  5997. if (!this.isVideo(url))
  5998. return url;
  5999. if (url.includes("?x-oss-process") || url.includes("?ci-process") || url.includes("?vframe")) {
  6000. return url;
  6001. }
  6002. const aliyun = `?x-oss-process=video/snapshot,t_1,f_jpg,w_300,m_fast`;
  6003. const tencent = `?ci-process=snapshot&time=1`;
  6004. if (url.includes("myqcloud.com")) {
  6005. return url + tencent;
  6006. }
  6007. return url + aliyun;
  6008. },
  6009. /**
  6010. * 统一预览媒体
  6011. */
  6012. previewMedia(medias, currentIdx) {
  6013. const url = medias[currentIdx];
  6014. if (this.isVideo(url)) {
  6015. this.videoPlayerUrl = url;
  6016. this.videoPlayerShow = true;
  6017. } else {
  6018. const imageUrls = medias.filter((m) => !this.isVideo(m));
  6019. const currentImgUrl = url;
  6020. const newIdx = imageUrls.indexOf(currentImgUrl);
  6021. uni.previewImage({
  6022. current: newIdx >= 0 ? newIdx : 0,
  6023. urls: imageUrls
  6024. });
  6025. }
  6026. },
  6027. closeVideoPlayer() {
  6028. this.videoPlayerShow = false;
  6029. this.videoPlayerUrl = "";
  6030. }
  6031. }
  6032. };
  6033. const _imports_12 = "/static/icons/phone_orange.svg";
  6034. const _imports_1$8 = "/static/icons/clock.svg";
  6035. const _imports_0$2 = "/static/icons/right_arrow_orange.svg";
  6036. const _imports_4$1 = "/static/icons/file.svg";
  6037. const _imports_1$7 = "/static/icons/camera_grey.svg";
  6038. const _imports_6$1 = "/static/icons/order_no.svg";
  6039. const _imports_7 = "/static/icons/play_circle.svg";
  6040. const _imports_8$1 = "/static/empty-rest.png";
  6041. const _sfc_main$r = {
  6042. ...logic$1
  6043. };
  6044. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  6045. return vue.openBlock(), vue.createElementBlock("view", { class: "detail-container" }, [
  6046. _ctx.pageLoading ? (vue.openBlock(), vue.createElementBlock("view", {
  6047. key: 0,
  6048. class: "loading-container"
  6049. }, [
  6050. vue.createElementVNode("view", { class: "skeleton-header" }, [
  6051. vue.createElementVNode("view", {
  6052. class: "skeleton-line skeleton-ani",
  6053. style: { "width": "30%", "height": "36rpx" }
  6054. }),
  6055. vue.createElementVNode("view", {
  6056. class: "skeleton-line skeleton-ani",
  6057. style: { "width": "20%", "height": "36rpx" }
  6058. })
  6059. ]),
  6060. vue.createElementVNode("view", { class: "skeleton-progress" }, [
  6061. (vue.openBlock(), vue.createElementBlock(
  6062. vue.Fragment,
  6063. null,
  6064. vue.renderList(4, (i) => {
  6065. return vue.createElementVNode("view", {
  6066. class: "skeleton-circle skeleton-ani",
  6067. key: i
  6068. });
  6069. }),
  6070. 64
  6071. /* STABLE_FRAGMENT */
  6072. ))
  6073. ]),
  6074. (vue.openBlock(), vue.createElementBlock(
  6075. vue.Fragment,
  6076. null,
  6077. vue.renderList(3, (j) => {
  6078. return vue.createElementVNode("view", {
  6079. class: "skeleton-card",
  6080. key: "c" + j
  6081. }, [
  6082. vue.createElementVNode("view", {
  6083. class: "skeleton-line skeleton-ani",
  6084. style: { "width": "60%", "height": "28rpx", "margin-bottom": "20rpx" }
  6085. }),
  6086. vue.createElementVNode("view", {
  6087. class: "skeleton-line skeleton-ani",
  6088. style: { "width": "90%", "height": "24rpx", "margin-bottom": "14rpx" }
  6089. }),
  6090. vue.createElementVNode("view", {
  6091. class: "skeleton-line skeleton-ani",
  6092. style: { "width": "75%", "height": "24rpx" }
  6093. })
  6094. ]);
  6095. }),
  6096. 64
  6097. /* STABLE_FRAGMENT */
  6098. ))
  6099. ])) : (vue.openBlock(), vue.createElementBlock(
  6100. vue.Fragment,
  6101. { key: 1 },
  6102. [
  6103. vue.createElementVNode("view", { class: "detail-header" }, [
  6104. vue.createElementVNode("view", { class: "status-row" }, [
  6105. vue.createElementVNode(
  6106. "text",
  6107. { class: "status-title" },
  6108. vue.toDisplayString(_ctx.displayStatusText),
  6109. 1
  6110. /* TEXT */
  6111. ),
  6112. vue.createElementVNode(
  6113. "text",
  6114. { class: "status-price" },
  6115. "¥" + vue.toDisplayString(_ctx.orderDetail.price),
  6116. 1
  6117. /* TEXT */
  6118. )
  6119. ]),
  6120. vue.createElementVNode("view", { class: "progress-bar" }, [
  6121. (vue.openBlock(true), vue.createElementBlock(
  6122. vue.Fragment,
  6123. null,
  6124. vue.renderList(_ctx.progressSteps, (step, index) => {
  6125. return vue.openBlock(), vue.createElementBlock(
  6126. "view",
  6127. {
  6128. class: vue.normalizeClass(["step-item", { "active": index === _ctx.progressIndex, "done": index < _ctx.progressIndex }]),
  6129. key: index
  6130. },
  6131. [
  6132. vue.createElementVNode("view", { class: "step-circle-wrapper" }, [
  6133. index !== 0 ? (vue.openBlock(), vue.createElementBlock(
  6134. "view",
  6135. {
  6136. key: 0,
  6137. class: vue.normalizeClass(["step-line", { "active-line": index <= _ctx.progressIndex }])
  6138. },
  6139. null,
  6140. 2
  6141. /* CLASS */
  6142. )) : vue.createCommentVNode("v-if", true),
  6143. vue.createElementVNode(
  6144. "view",
  6145. { class: "step-circle" },
  6146. vue.toDisplayString(index + 1),
  6147. 1
  6148. /* TEXT */
  6149. )
  6150. ]),
  6151. vue.createElementVNode(
  6152. "text",
  6153. { class: "step-text" },
  6154. vue.toDisplayString(step),
  6155. 1
  6156. /* TEXT */
  6157. )
  6158. ],
  6159. 2
  6160. /* CLASS */
  6161. );
  6162. }),
  6163. 128
  6164. /* KEYED_FRAGMENT */
  6165. ))
  6166. ])
  6167. ]),
  6168. vue.createElementVNode("scroll-view", {
  6169. "scroll-y": "",
  6170. class: "detail-content"
  6171. }, [
  6172. vue.createElementVNode("view", { class: "white-card pet-bar" }, [
  6173. vue.createElementVNode("image", {
  6174. class: "pb-avatar",
  6175. src: _ctx.orderDetail.petAvatar,
  6176. mode: "aspectFill"
  6177. }, null, 8, ["src"]),
  6178. vue.createElementVNode("view", { class: "pb-info" }, [
  6179. vue.createElementVNode("view", { class: "pb-name-row" }, [
  6180. vue.createElementVNode(
  6181. "text",
  6182. { class: "pb-name" },
  6183. vue.toDisplayString(_ctx.orderDetail.petName),
  6184. 1
  6185. /* TEXT */
  6186. )
  6187. ]),
  6188. vue.createElementVNode("view", { class: "pb-tags" }, [
  6189. vue.createElementVNode(
  6190. "text",
  6191. { class: "pb-tag" },
  6192. vue.toDisplayString(_ctx.orderDetail.serviceName),
  6193. 1
  6194. /* TEXT */
  6195. )
  6196. ])
  6197. ]),
  6198. vue.createElementVNode("view", { class: "pb-actions" }, [
  6199. vue.createElementVNode("view", {
  6200. class: "pb-btn profile-btn",
  6201. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.showPetProfile && _ctx.showPetProfile(...args))
  6202. }, "宠物档案"),
  6203. vue.createElementVNode("view", {
  6204. class: "pb-btn phone-btn",
  6205. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.callPhone && _ctx.callPhone(...args))
  6206. }, [
  6207. vue.createElementVNode("image", {
  6208. class: "phone-icon",
  6209. src: _imports_12
  6210. })
  6211. ])
  6212. ])
  6213. ]),
  6214. vue.createElementVNode("view", { class: "white-card service-info-card" }, [
  6215. vue.createElementVNode("view", { class: "si-row time-row" }, [
  6216. vue.createElementVNode("image", {
  6217. class: "si-icon outline",
  6218. src: _imports_1$8
  6219. }),
  6220. vue.createElementVNode("view", { class: "si-content" }, [
  6221. vue.createElementVNode("text", { class: "si-label" }, "服务时间"),
  6222. vue.createElementVNode(
  6223. "text",
  6224. { class: "si-val" },
  6225. vue.toDisplayString(_ctx.orderDetail.time),
  6226. 1
  6227. /* TEXT */
  6228. )
  6229. ]),
  6230. vue.createElementVNode("view", {
  6231. class: "si-action record-btn",
  6232. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.openAnomalyModal && _ctx.openAnomalyModal(...args), ["stop"]))
  6233. }, [
  6234. vue.createElementVNode("text", null, "异常记录"),
  6235. vue.createElementVNode("image", {
  6236. class: "record-arrow",
  6237. src: _imports_0$2
  6238. })
  6239. ])
  6240. ]),
  6241. _ctx.orderDetail.type === 1 ? (vue.openBlock(), vue.createElementBlock(
  6242. vue.Fragment,
  6243. { key: 0 },
  6244. [
  6245. vue.createElementVNode("view", { class: "si-row addr-row start-addr" }, [
  6246. vue.createElementVNode("view", { class: "icon-circle start" }, "起"),
  6247. vue.createElementVNode("view", { class: "route-line-vertical" }),
  6248. vue.createElementVNode("view", { class: "si-content" }, [
  6249. vue.createElementVNode(
  6250. "text",
  6251. { class: "si-addr-title" },
  6252. vue.toDisplayString(_ctx.orderDetail.startLocation),
  6253. 1
  6254. /* TEXT */
  6255. ),
  6256. vue.createElementVNode(
  6257. "text",
  6258. { class: "si-addr-desc" },
  6259. vue.toDisplayString(_ctx.orderDetail.startAddress),
  6260. 1
  6261. /* TEXT */
  6262. )
  6263. ]),
  6264. vue.createElementVNode("view", {
  6265. class: "nav-btn-circle",
  6266. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.openNavigation("start"))
  6267. }, [
  6268. vue.createElementVNode("image", {
  6269. class: "nav-arrow",
  6270. src: _imports_3$2
  6271. })
  6272. ])
  6273. ]),
  6274. vue.createElementVNode("view", { class: "si-row addr-row end-addr" }, [
  6275. vue.createElementVNode("view", { class: "icon-circle end" }, "终"),
  6276. vue.createElementVNode("view", { class: "si-content" }, [
  6277. vue.createElementVNode(
  6278. "text",
  6279. { class: "si-addr-title" },
  6280. vue.toDisplayString(_ctx.orderDetail.endLocation),
  6281. 1
  6282. /* TEXT */
  6283. ),
  6284. vue.createElementVNode(
  6285. "text",
  6286. { class: "si-addr-desc" },
  6287. vue.toDisplayString(_ctx.orderDetail.endAddress),
  6288. 1
  6289. /* TEXT */
  6290. )
  6291. ]),
  6292. vue.createElementVNode("view", {
  6293. class: "nav-btn-circle",
  6294. onClick: _cache[4] || (_cache[4] = ($event) => _ctx.openNavigation("end"))
  6295. }, [
  6296. vue.createElementVNode("image", {
  6297. class: "nav-arrow",
  6298. src: _imports_3$2
  6299. })
  6300. ])
  6301. ])
  6302. ],
  6303. 64
  6304. /* STABLE_FRAGMENT */
  6305. )) : (vue.openBlock(), vue.createElementBlock("view", {
  6306. key: 1,
  6307. class: "si-row addr-row end-addr"
  6308. }, [
  6309. vue.createElementVNode("view", { class: "icon-circle service" }, "服"),
  6310. vue.createElementVNode("view", { class: "si-content" }, [
  6311. vue.createElementVNode(
  6312. "text",
  6313. { class: "si-addr-title" },
  6314. vue.toDisplayString(_ctx.orderDetail.endLocation),
  6315. 1
  6316. /* TEXT */
  6317. ),
  6318. vue.createElementVNode(
  6319. "text",
  6320. { class: "si-addr-desc" },
  6321. vue.toDisplayString(_ctx.orderDetail.endAddress),
  6322. 1
  6323. /* TEXT */
  6324. )
  6325. ]),
  6326. vue.createElementVNode("view", {
  6327. class: "nav-btn-circle",
  6328. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.openNavigation("end"))
  6329. }, [
  6330. vue.createElementVNode("image", {
  6331. class: "nav-arrow",
  6332. src: _imports_3$2
  6333. })
  6334. ])
  6335. ])),
  6336. vue.createElementVNode("view", { class: "si-row" }, [
  6337. vue.createElementVNode("image", {
  6338. class: "si-icon outline custom-icon-file",
  6339. src: _imports_4$1
  6340. }),
  6341. vue.createElementVNode("view", { class: "si-content" }, [
  6342. vue.createElementVNode("text", { class: "si-label" }, "备注"),
  6343. vue.createElementVNode(
  6344. "text",
  6345. { class: "si-val" },
  6346. vue.toDisplayString(_ctx.orderDetail.remark || "无"),
  6347. 1
  6348. /* TEXT */
  6349. )
  6350. ])
  6351. ])
  6352. ]),
  6353. _ctx.currentStep < _ctx.steps.length ? (vue.openBlock(), vue.createElementBlock("view", {
  6354. key: 0,
  6355. class: "white-card task-card"
  6356. }, [
  6357. vue.createElementVNode(
  6358. "text",
  6359. { class: "tc-title" },
  6360. "当前任务:" + vue.toDisplayString(_ctx.currentTaskTitle),
  6361. 1
  6362. /* TEXT */
  6363. ),
  6364. vue.createElementVNode(
  6365. "text",
  6366. { class: "tc-desc" },
  6367. vue.toDisplayString(_ctx.currentTaskDesc),
  6368. 1
  6369. /* TEXT */
  6370. ),
  6371. vue.createElementVNode("view", {
  6372. class: "full-media-add",
  6373. onClick: _cache[6] || (_cache[6] = (...args) => _ctx.openUploadModal && _ctx.openUploadModal(...args))
  6374. }, [
  6375. vue.createElementVNode("image", {
  6376. class: "upload-icon-large",
  6377. src: _imports_1$7
  6378. }),
  6379. vue.createElementVNode("text", { class: "upload-text-large" }, "上传图或视频")
  6380. ])
  6381. ])) : vue.createCommentVNode("v-if", true),
  6382. vue.createElementVNode("view", { class: "white-card base-info-card" }, [
  6383. vue.createElementVNode("view", { class: "bi-row" }, [
  6384. vue.createElementVNode("image", {
  6385. class: "si-icon outline",
  6386. src: _imports_6$1
  6387. }),
  6388. vue.createElementVNode("view", { class: "bi-content" }, [
  6389. vue.createElementVNode("text", { class: "bi-label" }, "订单编号"),
  6390. vue.createElementVNode("view", { class: "bi-val-row" }, [
  6391. vue.createElementVNode(
  6392. "text",
  6393. { class: "bi-val" },
  6394. vue.toDisplayString(_ctx.orderDetail.orderNo),
  6395. 1
  6396. /* TEXT */
  6397. ),
  6398. vue.createElementVNode("text", {
  6399. class: "bi-copy",
  6400. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.copyOrderNo && _ctx.copyOrderNo(...args))
  6401. }, "复制")
  6402. ])
  6403. ])
  6404. ]),
  6405. vue.createElementVNode("view", { class: "bi-row" }, [
  6406. vue.createElementVNode("image", {
  6407. class: "si-icon outline",
  6408. src: _imports_1$8
  6409. }),
  6410. vue.createElementVNode("view", { class: "bi-content" }, [
  6411. vue.createElementVNode("text", { class: "bi-label" }, "下单时间"),
  6412. vue.createElementVNode(
  6413. "text",
  6414. { class: "bi-val" },
  6415. vue.toDisplayString(_ctx.orderDetail.createTime),
  6416. 1
  6417. /* TEXT */
  6418. )
  6419. ])
  6420. ])
  6421. ]),
  6422. vue.createElementVNode("view", { class: "white-card timeline-card" }, [
  6423. vue.createElementVNode("view", { class: "tl-title-row" }, [
  6424. vue.createElementVNode("view", { class: "orange-bar" }),
  6425. vue.createElementVNode("text", { class: "tl-title" }, "订单进度")
  6426. ]),
  6427. vue.createElementVNode("view", { class: "tl-list" }, [
  6428. (vue.openBlock(true), vue.createElementBlock(
  6429. vue.Fragment,
  6430. null,
  6431. vue.renderList(_ctx.orderDetail.progressLogs, (log, idx) => {
  6432. return vue.openBlock(), vue.createElementBlock("view", {
  6433. class: "tl-item",
  6434. key: idx
  6435. }, [
  6436. vue.createElementVNode("view", { class: "tl-marker active" }, [
  6437. vue.createElementVNode("view", { class: "tl-dot-inner" })
  6438. ]),
  6439. vue.createElementVNode("view", { class: "tl-content-row" }, [
  6440. vue.createElementVNode("view", { class: "tl-header" }, [
  6441. vue.createElementVNode(
  6442. "text",
  6443. { class: "tl-status" },
  6444. vue.toDisplayString(log.status),
  6445. 1
  6446. /* TEXT */
  6447. ),
  6448. vue.createElementVNode(
  6449. "text",
  6450. { class: "tl-time" },
  6451. vue.toDisplayString(log.time),
  6452. 1
  6453. /* TEXT */
  6454. )
  6455. ]),
  6456. log.medias && log.medias.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  6457. key: 0,
  6458. class: "tl-medias"
  6459. }, [
  6460. (vue.openBlock(true), vue.createElementBlock(
  6461. vue.Fragment,
  6462. null,
  6463. vue.renderList(log.medias, (media, midx) => {
  6464. return vue.openBlock(), vue.createElementBlock("view", {
  6465. class: "tl-media-item",
  6466. key: midx,
  6467. onClick: ($event) => _ctx.previewMedia(log.medias, midx)
  6468. }, [
  6469. !_ctx.isVideo(media) ? (vue.openBlock(), vue.createElementBlock("image", {
  6470. key: 0,
  6471. class: "tl-img",
  6472. src: media,
  6473. mode: "aspectFill"
  6474. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("view", {
  6475. key: 1,
  6476. class: "tl-video-placeholder"
  6477. }, [
  6478. vue.createElementVNode("view", { class: "tl-play-icon" }),
  6479. vue.createElementVNode("text", { class: "tl-video-label" }, "视频")
  6480. ]))
  6481. ], 8, ["onClick"]);
  6482. }),
  6483. 128
  6484. /* KEYED_FRAGMENT */
  6485. ))
  6486. ])) : vue.createCommentVNode("v-if", true),
  6487. log.remark ? (vue.openBlock(), vue.createElementBlock("view", {
  6488. key: 1,
  6489. class: "tl-remark"
  6490. }, [
  6491. vue.createElementVNode(
  6492. "text",
  6493. null,
  6494. vue.toDisplayString(log.remark),
  6495. 1
  6496. /* TEXT */
  6497. )
  6498. ])) : vue.createCommentVNode("v-if", true)
  6499. ])
  6500. ]);
  6501. }),
  6502. 128
  6503. /* KEYED_FRAGMENT */
  6504. ))
  6505. ])
  6506. ]),
  6507. vue.createElementVNode("view", { style: { "height": "140rpx" } })
  6508. ]),
  6509. vue.createElementVNode("view", { class: "bottom-action-bar" }, [
  6510. vue.createElementVNode("view", { class: "action-left" }, [
  6511. vue.createElementVNode("button", {
  6512. class: "action-btn outline grey-outline",
  6513. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.goToAnomaly && _ctx.goToAnomaly(...args))
  6514. }, "异常上报"),
  6515. _ctx.serviceMode === 0 ? (vue.openBlock(), vue.createElementBlock("button", {
  6516. key: 0,
  6517. class: "action-btn outline orange-outline",
  6518. onClick: _cache[9] || (_cache[9] = (...args) => _ctx.openSumModal && _ctx.openSumModal(...args))
  6519. }, "宠护小结")) : vue.createCommentVNode("v-if", true)
  6520. ]),
  6521. vue.createElementVNode("view", { class: "action-right" }, [
  6522. _ctx.currentStep < _ctx.steps.length ? (vue.openBlock(), vue.createElementBlock(
  6523. "button",
  6524. {
  6525. key: 0,
  6526. class: "action-btn primary",
  6527. onClick: _cache[10] || (_cache[10] = (...args) => _ctx.openUploadModal && _ctx.openUploadModal(...args))
  6528. },
  6529. vue.toDisplayString(_ctx.currentTaskTitle),
  6530. 1
  6531. /* TEXT */
  6532. )) : (vue.openBlock(), vue.createElementBlock("button", {
  6533. key: 1,
  6534. class: "action-btn primary grey-bg"
  6535. }, "已完成"))
  6536. ])
  6537. ]),
  6538. _ctx.showPetModal ? (vue.openBlock(), vue.createElementBlock("view", {
  6539. key: 0,
  6540. class: "pet-modal-mask",
  6541. onClick: _cache[14] || (_cache[14] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  6542. }, [
  6543. vue.createElementVNode("view", {
  6544. class: "pet-modal-content",
  6545. onClick: _cache[13] || (_cache[13] = vue.withModifiers(() => {
  6546. }, ["stop"]))
  6547. }, [
  6548. vue.createElementVNode("view", { class: "pet-modal-header" }, [
  6549. vue.createElementVNode("text", { class: "pet-modal-title" }, "宠物档案"),
  6550. vue.createElementVNode("view", { style: { "flex": "1" } }),
  6551. vue.createElementVNode("view", {
  6552. class: "pm-remark-btn",
  6553. onClick: _cache[11] || (_cache[11] = (...args) => _ctx.openPetRemarkInput && _ctx.openPetRemarkInput(...args))
  6554. }, "备注"),
  6555. vue.createElementVNode("view", {
  6556. class: "close-icon-btn",
  6557. onClick: _cache[12] || (_cache[12] = (...args) => _ctx.closePetProfile && _ctx.closePetProfile(...args))
  6558. }, "×")
  6559. ]),
  6560. vue.createElementVNode("scroll-view", {
  6561. "scroll-y": "",
  6562. class: "pet-modal-scroll"
  6563. }, [
  6564. vue.createElementVNode("view", { class: "pet-base-info" }, [
  6565. vue.createElementVNode("image", {
  6566. class: "pm-avatar",
  6567. src: _ctx.currentPetInfo.petAvatar,
  6568. mode: "aspectFill"
  6569. }, null, 8, ["src"]),
  6570. vue.createElementVNode("view", { class: "pm-info-text" }, [
  6571. vue.createElementVNode("view", { class: "pm-name-row" }, [
  6572. vue.createElementVNode(
  6573. "text",
  6574. { class: "pm-name" },
  6575. vue.toDisplayString(_ctx.currentPetInfo.petName),
  6576. 1
  6577. /* TEXT */
  6578. ),
  6579. _ctx.currentPetInfo.petGender === "M" ? (vue.openBlock(), vue.createElementBlock("view", {
  6580. key: 0,
  6581. class: "pm-gender"
  6582. }, [
  6583. vue.createElementVNode("text", { class: "gender-icon" }, "♂"),
  6584. vue.createElementVNode("text", null, "公")
  6585. ])) : _ctx.currentPetInfo.petGender === "F" ? (vue.openBlock(), vue.createElementBlock("view", {
  6586. key: 1,
  6587. class: "pm-gender female"
  6588. }, [
  6589. vue.createElementVNode("text", { class: "gender-icon" }, "♀"),
  6590. vue.createElementVNode("text", null, "母")
  6591. ])) : vue.createCommentVNode("v-if", true)
  6592. ]),
  6593. vue.createElementVNode(
  6594. "text",
  6595. { class: "pm-breed" },
  6596. "品种:" + vue.toDisplayString(_ctx.currentPetInfo.petBreed),
  6597. 1
  6598. /* TEXT */
  6599. )
  6600. ])
  6601. ]),
  6602. vue.createElementVNode("view", { class: "pm-detail-grid" }, [
  6603. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  6604. vue.createElementVNode("text", { class: "pm-label" }, "年龄"),
  6605. vue.createElementVNode(
  6606. "text",
  6607. { class: "pm-val" },
  6608. vue.toDisplayString(_ctx.currentPetInfo.petAge || "未知"),
  6609. 1
  6610. /* TEXT */
  6611. )
  6612. ]),
  6613. vue.createElementVNode("view", { class: "pm-grid-item half" }, [
  6614. vue.createElementVNode("text", { class: "pm-label" }, "体重"),
  6615. vue.createElementVNode(
  6616. "text",
  6617. { class: "pm-val" },
  6618. vue.toDisplayString(_ctx.currentPetInfo.petWeight || "未知"),
  6619. 1
  6620. /* TEXT */
  6621. )
  6622. ]),
  6623. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  6624. vue.createElementVNode("text", { class: "pm-label" }, "性格"),
  6625. vue.createElementVNode(
  6626. "text",
  6627. { class: "pm-val" },
  6628. vue.toDisplayString(_ctx.currentPetInfo.petPersonality || "无"),
  6629. 1
  6630. /* TEXT */
  6631. )
  6632. ]),
  6633. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  6634. vue.createElementVNode("text", { class: "pm-label" }, "爱好"),
  6635. vue.createElementVNode(
  6636. "text",
  6637. { class: "pm-val" },
  6638. vue.toDisplayString(_ctx.currentPetInfo.petHobby || "无"),
  6639. 1
  6640. /* TEXT */
  6641. )
  6642. ]),
  6643. vue.createElementVNode("view", { class: "pm-grid-item full" }, [
  6644. vue.createElementVNode("text", { class: "pm-label" }, "备注"),
  6645. vue.createElementVNode(
  6646. "text",
  6647. { class: "pm-val" },
  6648. vue.toDisplayString(_ctx.currentPetInfo.petRemark || "无特殊过敏史"),
  6649. 1
  6650. /* TEXT */
  6651. )
  6652. ])
  6653. ]),
  6654. _ctx.currentPetInfo.petTags && _ctx.currentPetInfo.petTags.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  6655. key: 0,
  6656. class: "pm-tags-row"
  6657. }, [
  6658. (vue.openBlock(true), vue.createElementBlock(
  6659. vue.Fragment,
  6660. null,
  6661. vue.renderList(_ctx.currentPetInfo.petTags, (tag, ti) => {
  6662. return vue.openBlock(), vue.createElementBlock("view", {
  6663. class: "pm-tag-chip",
  6664. key: ti
  6665. }, [
  6666. vue.createElementVNode(
  6667. "text",
  6668. { class: "pm-tag-chip-text" },
  6669. vue.toDisplayString(tag),
  6670. 1
  6671. /* TEXT */
  6672. )
  6673. ]);
  6674. }),
  6675. 128
  6676. /* KEYED_FRAGMENT */
  6677. ))
  6678. ])) : vue.createCommentVNode("v-if", true),
  6679. vue.createElementVNode("view", { class: "pm-log-section" }, [
  6680. vue.createElementVNode("view", { class: "pm-log-header" }, [
  6681. vue.createElementVNode("view", { style: { "width": "6rpx", "height": "28rpx", "background": "#FF9800", "border-radius": "3rpx", "margin-right": "12rpx" } }),
  6682. vue.createElementVNode("text", { class: "pm-log-section-title" }, "备注日志")
  6683. ]),
  6684. (vue.openBlock(true), vue.createElementBlock(
  6685. vue.Fragment,
  6686. null,
  6687. vue.renderList(_ctx.currentPetInfo.petLogs, (log, lIndex) => {
  6688. return vue.openBlock(), vue.createElementBlock("view", {
  6689. class: "pm-log-item",
  6690. key: lIndex
  6691. }, [
  6692. vue.createElementVNode(
  6693. "text",
  6694. { class: "pm-log-date" },
  6695. vue.toDisplayString(log.date),
  6696. 1
  6697. /* TEXT */
  6698. ),
  6699. vue.createElementVNode(
  6700. "text",
  6701. { class: "pm-log-text" },
  6702. vue.toDisplayString(log.content),
  6703. 1
  6704. /* TEXT */
  6705. ),
  6706. log.recorder !== "系统记录" ? (vue.openBlock(), vue.createElementBlock(
  6707. "text",
  6708. {
  6709. key: 0,
  6710. class: "pm-log-recorder"
  6711. },
  6712. "记录人:" + vue.toDisplayString(log.recorder),
  6713. 1
  6714. /* TEXT */
  6715. )) : (vue.openBlock(), vue.createElementBlock("text", {
  6716. key: 1,
  6717. class: "pm-log-recorder system"
  6718. }, "系统记录"))
  6719. ]);
  6720. }),
  6721. 128
  6722. /* KEYED_FRAGMENT */
  6723. ))
  6724. ]),
  6725. vue.createElementVNode("view", { style: { "height": "30rpx" } })
  6726. ])
  6727. ])
  6728. ])) : vue.createCommentVNode("v-if", true),
  6729. _ctx.showPetRemarkInput ? (vue.openBlock(), vue.createElementBlock("view", {
  6730. key: 1,
  6731. class: "upload-modal-mask",
  6732. onClick: _cache[18] || (_cache[18] = (...args) => _ctx.closePetRemarkInput && _ctx.closePetRemarkInput(...args))
  6733. }, [
  6734. vue.createElementVNode("view", {
  6735. class: "upload-modal-content",
  6736. onClick: _cache[17] || (_cache[17] = vue.withModifiers(() => {
  6737. }, ["stop"]))
  6738. }, [
  6739. vue.createElementVNode("view", { class: "um-header" }, [
  6740. vue.createElementVNode("text", { class: "um-title" }, "添加备注")
  6741. ]),
  6742. vue.createElementVNode("view", { class: "um-body" }, [
  6743. vue.withDirectives(vue.createElementVNode(
  6744. "textarea",
  6745. {
  6746. class: "um-textarea",
  6747. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.petRemarkText = $event),
  6748. "auto-height": "",
  6749. placeholder: "请输入宠物备注内容...",
  6750. "placeholder-style": "color:#ccc; font-size:26rpx;"
  6751. },
  6752. null,
  6753. 512
  6754. /* NEED_PATCH */
  6755. ), [
  6756. [vue.vModelText, _ctx.petRemarkText]
  6757. ])
  6758. ]),
  6759. vue.createElementVNode("view", { class: "um-footer" }, [
  6760. vue.createElementVNode("button", {
  6761. class: "um-submit-btn active",
  6762. onClick: _cache[16] || (_cache[16] = (...args) => _ctx.submitPetRemark && _ctx.submitPetRemark(...args))
  6763. }, "确认提交")
  6764. ])
  6765. ])
  6766. ])) : vue.createCommentVNode("v-if", true),
  6767. _ctx.showNavModal ? (vue.openBlock(), vue.createElementBlock("view", {
  6768. key: 2,
  6769. class: "nav-modal-mask",
  6770. onClick: _cache[24] || (_cache[24] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  6771. }, [
  6772. vue.createElementVNode("view", {
  6773. class: "nav-action-sheet",
  6774. onClick: _cache[23] || (_cache[23] = vue.withModifiers(() => {
  6775. }, ["stop"]))
  6776. }, [
  6777. vue.createElementVNode("view", { class: "nav-sheet-title" }, "选择地图进行导航"),
  6778. vue.createElementVNode("view", {
  6779. class: "nav-sheet-item",
  6780. onClick: _cache[19] || (_cache[19] = ($event) => _ctx.chooseMap("高德"))
  6781. }, "高德地图"),
  6782. vue.createElementVNode("view", {
  6783. class: "nav-sheet-item",
  6784. onClick: _cache[20] || (_cache[20] = ($event) => _ctx.chooseMap("腾讯"))
  6785. }, "腾讯地图"),
  6786. vue.createElementVNode("view", {
  6787. class: "nav-sheet-item",
  6788. onClick: _cache[21] || (_cache[21] = ($event) => _ctx.chooseMap("百度"))
  6789. }, "百度地图"),
  6790. vue.createElementVNode("view", { class: "nav-sheet-gap" }),
  6791. vue.createElementVNode("view", {
  6792. class: "nav-sheet-item cancel",
  6793. onClick: _cache[22] || (_cache[22] = (...args) => _ctx.closeNavModal && _ctx.closeNavModal(...args))
  6794. }, "取消")
  6795. ])
  6796. ])) : vue.createCommentVNode("v-if", true),
  6797. _ctx.showUploadModal ? (vue.openBlock(), vue.createElementBlock("view", {
  6798. key: 3,
  6799. class: "upload-modal-mask",
  6800. onClick: _cache[29] || (_cache[29] = (...args) => _ctx.closeUploadModal && _ctx.closeUploadModal(...args))
  6801. }, [
  6802. vue.createElementVNode("view", {
  6803. class: "upload-modal-content",
  6804. onClick: _cache[28] || (_cache[28] = vue.withModifiers(() => {
  6805. }, ["stop"]))
  6806. }, [
  6807. vue.createElementVNode("view", { class: "um-header" }, [
  6808. vue.createElementVNode(
  6809. "text",
  6810. { class: "um-title" },
  6811. "上传图或视频 (" + vue.toDisplayString(_ctx.modalMediaList.length) + "/5)",
  6812. 1
  6813. /* TEXT */
  6814. ),
  6815. vue.createElementVNode(
  6816. "text",
  6817. { class: "um-remark-hint" },
  6818. vue.toDisplayString(_ctx.currentTaskDesc),
  6819. 1
  6820. /* TEXT */
  6821. )
  6822. ]),
  6823. vue.createElementVNode("view", { class: "um-body" }, [
  6824. vue.createElementVNode("view", { class: "um-grid" }, [
  6825. (vue.openBlock(true), vue.createElementBlock(
  6826. vue.Fragment,
  6827. null,
  6828. vue.renderList(_ctx.modalMediaList, (img, idx) => {
  6829. return vue.openBlock(), vue.createElementBlock("view", {
  6830. class: "um-item",
  6831. key: idx
  6832. }, [
  6833. vue.createElementVNode("image", {
  6834. class: "um-preview",
  6835. src: img.thumb || img.url || img.localPath || img,
  6836. mode: "aspectFill"
  6837. }, null, 8, ["src"]),
  6838. img.mediaType === "video" ? (vue.openBlock(), vue.createElementBlock("view", {
  6839. key: 0,
  6840. class: "um-video-badge"
  6841. }, [
  6842. vue.createElementVNode("image", {
  6843. class: "play-icon-small",
  6844. src: _imports_7
  6845. })
  6846. ])) : vue.createCommentVNode("v-if", true),
  6847. vue.createElementVNode("view", {
  6848. class: "um-del",
  6849. onClick: ($event) => _ctx.removeModalMedia(idx)
  6850. }, "×", 8, ["onClick"])
  6851. ]);
  6852. }),
  6853. 128
  6854. /* KEYED_FRAGMENT */
  6855. )),
  6856. _ctx.modalMediaList.length < 5 ? (vue.openBlock(), vue.createElementBlock("view", {
  6857. key: 0,
  6858. class: "um-add",
  6859. onClick: _cache[25] || (_cache[25] = (...args) => _ctx.chooseModalMedia && _ctx.chooseModalMedia(...args))
  6860. }, [
  6861. vue.createElementVNode("image", {
  6862. class: "um-add-icon",
  6863. src: _imports_1$7
  6864. }),
  6865. vue.createElementVNode("text", { class: "um-add-text" }, "拍摄/上传")
  6866. ])) : vue.createCommentVNode("v-if", true)
  6867. ]),
  6868. vue.withDirectives(vue.createElementVNode(
  6869. "textarea",
  6870. {
  6871. class: "um-textarea",
  6872. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => _ctx.modalRemark = $event),
  6873. placeholder: "在此输入备注信息...",
  6874. "placeholder-style": "color:#ccc; font-size:26rpx;"
  6875. },
  6876. null,
  6877. 512
  6878. /* NEED_PATCH */
  6879. ), [
  6880. [vue.vModelText, _ctx.modalRemark]
  6881. ])
  6882. ]),
  6883. vue.createElementVNode("view", { class: "um-footer" }, [
  6884. vue.createElementVNode(
  6885. "view",
  6886. {
  6887. class: vue.normalizeClass(["um-submit-btn", { "active": _ctx.modalMediaList.length > 0 }]),
  6888. onClick: _cache[27] || (_cache[27] = (...args) => _ctx.handleConfirmUpload && _ctx.handleConfirmUpload(...args))
  6889. },
  6890. " 确认提交",
  6891. 2
  6892. /* CLASS */
  6893. )
  6894. ])
  6895. ])
  6896. ])) : vue.createCommentVNode("v-if", true),
  6897. _ctx.showSumModal ? (vue.openBlock(), vue.createElementBlock("view", {
  6898. key: 4,
  6899. class: "sum-modal-mask",
  6900. onClick: _cache[33] || (_cache[33] = (...args) => _ctx.closeSumModal && _ctx.closeSumModal(...args))
  6901. }, [
  6902. vue.createElementVNode("view", {
  6903. class: "sum-modal-card",
  6904. onClick: _cache[32] || (_cache[32] = vue.withModifiers(() => {
  6905. }, ["stop"]))
  6906. }, [
  6907. vue.createElementVNode("scroll-view", {
  6908. "scroll-y": "",
  6909. class: "sum-modal-scroll"
  6910. }, [
  6911. vue.createElementVNode("view", { class: "sum-modal-inner" }, [
  6912. vue.createElementVNode("text", { class: "sum-modal-title" }, "宠物护理工作小结"),
  6913. vue.createElementVNode("view", { class: "sum-meta-row" }, [
  6914. vue.createElementVNode("text", { class: "sum-meta-label" }, "日期:"),
  6915. vue.createElementVNode(
  6916. "text",
  6917. { class: "sum-meta-val" },
  6918. vue.toDisplayString(_ctx.sumDate),
  6919. 1
  6920. /* TEXT */
  6921. )
  6922. ]),
  6923. vue.createElementVNode("view", { class: "sum-meta-row" }, [
  6924. vue.createElementVNode("text", { class: "sum-meta-label" }, "客户住址:"),
  6925. vue.createElementVNode(
  6926. "text",
  6927. { class: "sum-meta-val" },
  6928. vue.toDisplayString(_ctx.orderDetail.endAddress),
  6929. 1
  6930. /* TEXT */
  6931. )
  6932. ]),
  6933. vue.createElementVNode("view", { class: "sum-meta-row" }, [
  6934. vue.createElementVNode("text", { class: "sum-meta-label" }, "宠主姓名:"),
  6935. vue.createElementVNode(
  6936. "text",
  6937. { class: "sum-meta-val" },
  6938. vue.toDisplayString(_ctx.orderDetail.ownerName || "未知"),
  6939. 1
  6940. /* TEXT */
  6941. )
  6942. ]),
  6943. vue.createElementVNode("view", { class: "sum-section-title" }, "宠物信息"),
  6944. vue.createElementVNode("view", { class: "sum-pet-card" }, [
  6945. vue.createElementVNode("image", {
  6946. class: "sum-pet-avatar",
  6947. src: _ctx.orderDetail.petAvatar,
  6948. mode: "aspectFill"
  6949. }, null, 8, ["src"]),
  6950. vue.createElementVNode("view", { class: "sum-pet-info" }, [
  6951. vue.createElementVNode("view", { class: "sum-pet-name-row" }, [
  6952. vue.createElementVNode(
  6953. "text",
  6954. { class: "sum-pet-name" },
  6955. vue.toDisplayString(_ctx.orderDetail.petName || "未知"),
  6956. 1
  6957. /* TEXT */
  6958. ),
  6959. vue.createElementVNode(
  6960. "text",
  6961. { class: "sum-pet-breed" },
  6962. "品种: " + vue.toDisplayString(_ctx.orderDetail.petBreed || "未知"),
  6963. 1
  6964. /* TEXT */
  6965. )
  6966. ]),
  6967. vue.createElementVNode(
  6968. "text",
  6969. { class: "sum-pet-remark" },
  6970. vue.toDisplayString(_ctx.orderDetail.petNotes || "暂无备注"),
  6971. 1
  6972. /* TEXT */
  6973. )
  6974. ])
  6975. ]),
  6976. vue.createElementVNode("view", { class: "sum-section-title" }, "服务内容记录"),
  6977. vue.withDirectives(vue.createElementVNode(
  6978. "textarea",
  6979. {
  6980. class: "sum-textarea",
  6981. "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => _ctx.sumContent = $event),
  6982. "auto-height": "",
  6983. placeholder: "请填写服务内容...",
  6984. "placeholder-style": "color:#ccc"
  6985. },
  6986. null,
  6987. 512
  6988. /* NEED_PATCH */
  6989. ), [
  6990. [vue.vModelText, _ctx.sumContent]
  6991. ]),
  6992. vue.createElementVNode("view", { class: "sum-sign-row" }, [
  6993. vue.createElementVNode("text", { class: "sum-sign-label" }, "护宠师签名:"),
  6994. vue.createElementVNode(
  6995. "text",
  6996. { class: "sum-sign-val" },
  6997. vue.toDisplayString(_ctx.sumSigner),
  6998. 1
  6999. /* TEXT */
  7000. )
  7001. ]),
  7002. vue.createElementVNode("view", { style: { "height": "20rpx" } })
  7003. ])
  7004. ]),
  7005. vue.createElementVNode("view", { class: "sum-footer" }, [
  7006. vue.createElementVNode("button", {
  7007. class: "sum-submit-btn",
  7008. onClick: _cache[31] || (_cache[31] = (...args) => _ctx.submitSumModal && _ctx.submitSumModal(...args))
  7009. }, "提交小结")
  7010. ])
  7011. ])
  7012. ])) : vue.createCommentVNode("v-if", true),
  7013. _ctx.showAnomalyModal ? (vue.openBlock(), vue.createElementBlock("view", {
  7014. key: 5,
  7015. class: "modal-mask",
  7016. onClick: _cache[36] || (_cache[36] = (...args) => _ctx.closeAnomalyModal && _ctx.closeAnomalyModal(...args))
  7017. }, [
  7018. vue.createElementVNode("view", {
  7019. class: "anomaly-modal-content",
  7020. onClick: _cache[35] || (_cache[35] = vue.withModifiers(() => {
  7021. }, ["stop"]))
  7022. }, [
  7023. vue.createElementVNode("view", { class: "am-header" }, [
  7024. vue.createElementVNode("text", { class: "am-title" }, "历史异常记录"),
  7025. vue.createElementVNode("view", {
  7026. class: "close-icon-btn",
  7027. onClick: _cache[34] || (_cache[34] = (...args) => _ctx.closeAnomalyModal && _ctx.closeAnomalyModal(...args))
  7028. }, "×")
  7029. ]),
  7030. vue.createElementVNode("scroll-view", {
  7031. "scroll-y": "",
  7032. class: "am-scroll-list"
  7033. }, [
  7034. _ctx.anomalyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  7035. key: 0,
  7036. class: "empty-list"
  7037. }, [
  7038. vue.createElementVNode("image", {
  7039. class: "empty-icon",
  7040. src: _imports_8$1,
  7041. mode: "aspectFit"
  7042. }),
  7043. vue.createElementVNode("text", { class: "empty-text" }, "暂无异常记录")
  7044. ])) : vue.createCommentVNode("v-if", true),
  7045. (vue.openBlock(true), vue.createElementBlock(
  7046. vue.Fragment,
  7047. null,
  7048. vue.renderList(_ctx.anomalyList, (item, index) => {
  7049. return vue.openBlock(), vue.createElementBlock("view", {
  7050. class: "am-item",
  7051. key: index
  7052. }, [
  7053. vue.createElementVNode("view", { class: "am-item-header" }, [
  7054. vue.createElementVNode(
  7055. "text",
  7056. { class: "am-item-type" },
  7057. vue.toDisplayString(item.typeLabel),
  7058. 1
  7059. /* TEXT */
  7060. ),
  7061. vue.createElementVNode(
  7062. "text",
  7063. {
  7064. class: vue.normalizeClass(["am-item-status", "status-" + item.status])
  7065. },
  7066. vue.toDisplayString(_ctx.getAnomalyStatusLabel(item.status)),
  7067. 3
  7068. /* TEXT, CLASS */
  7069. )
  7070. ]),
  7071. vue.createElementVNode(
  7072. "text",
  7073. { class: "am-item-content" },
  7074. vue.toDisplayString(item.content),
  7075. 1
  7076. /* TEXT */
  7077. ),
  7078. item.photos && item.photos.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  7079. key: 0,
  7080. class: "am-item-photos"
  7081. }, [
  7082. (vue.openBlock(true), vue.createElementBlock(
  7083. vue.Fragment,
  7084. null,
  7085. vue.renderList(item.photoUrls, (photoUrl, pIdx) => {
  7086. return vue.openBlock(), vue.createElementBlock("view", {
  7087. class: "am-photo-item",
  7088. key: pIdx,
  7089. onClick: ($event) => _ctx.previewMedia(item.photoUrls, pIdx)
  7090. }, [
  7091. !_ctx.isVideo(photoUrl) ? (vue.openBlock(), vue.createElementBlock("image", {
  7092. key: 0,
  7093. class: "am-photo",
  7094. src: photoUrl,
  7095. mode: "aspectFill"
  7096. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("view", {
  7097. key: 1,
  7098. class: "tl-video-placeholder miniaturized"
  7099. }, [
  7100. vue.createElementVNode("view", { class: "tl-play-icon small" }),
  7101. vue.createElementVNode("text", { class: "tl-video-label small" }, "视频")
  7102. ]))
  7103. ], 8, ["onClick"]);
  7104. }),
  7105. 128
  7106. /* KEYED_FRAGMENT */
  7107. ))
  7108. ])) : vue.createCommentVNode("v-if", true),
  7109. item.status !== 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  7110. key: 1,
  7111. class: "am-audit-box"
  7112. }, [
  7113. vue.createElementVNode("view", { class: "am-audit-header" }, [
  7114. vue.createElementVNode(
  7115. "text",
  7116. { class: "am-audit-label" },
  7117. vue.toDisplayString(item.status === 1 ? "审核通过" : "驳回理由"),
  7118. 1
  7119. /* TEXT */
  7120. ),
  7121. vue.createElementVNode(
  7122. "text",
  7123. { class: "am-audit-time" },
  7124. vue.toDisplayString(item.auditTime),
  7125. 1
  7126. /* TEXT */
  7127. )
  7128. ]),
  7129. vue.createElementVNode(
  7130. "text",
  7131. { class: "am-audit-remark" },
  7132. vue.toDisplayString(item.auditRemark || "无"),
  7133. 1
  7134. /* TEXT */
  7135. )
  7136. ])) : vue.createCommentVNode("v-if", true)
  7137. ]);
  7138. }),
  7139. 128
  7140. /* KEYED_FRAGMENT */
  7141. ))
  7142. ])
  7143. ])
  7144. ])) : vue.createCommentVNode("v-if", true),
  7145. _ctx.videoPlayerShow ? (vue.openBlock(), vue.createElementBlock("view", {
  7146. key: 6,
  7147. class: "video-player-mask",
  7148. onClick: _cache[39] || (_cache[39] = (...args) => _ctx.closeVideoPlayer && _ctx.closeVideoPlayer(...args))
  7149. }, [
  7150. vue.createElementVNode("view", {
  7151. class: "video-player-content",
  7152. onClick: _cache[38] || (_cache[38] = vue.withModifiers(() => {
  7153. }, ["stop"]))
  7154. }, [
  7155. vue.createElementVNode("video", {
  7156. class: "v-player",
  7157. src: _ctx.videoPlayerUrl,
  7158. autoplay: "",
  7159. controls: ""
  7160. }, null, 8, ["src"]),
  7161. vue.createElementVNode("view", {
  7162. class: "v-close",
  7163. onClick: _cache[37] || (_cache[37] = (...args) => _ctx.closeVideoPlayer && _ctx.closeVideoPlayer(...args))
  7164. }, "×")
  7165. ])
  7166. ])) : vue.createCommentVNode("v-if", true)
  7167. ],
  7168. 64
  7169. /* STABLE_FRAGMENT */
  7170. ))
  7171. ]);
  7172. }
  7173. const PagesOrdersDetail = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/orders/detail.vue"]]);
  7174. const _sfc_main$q = {
  7175. data() {
  7176. return {
  7177. orderId: "",
  7178. // 已选异常类型(dictValue)
  7179. selectedTypeValue: "",
  7180. // 已选异常类型标签(dictLabel,用于显示)
  7181. selectedTypeLabel: "",
  7182. // 异常描述
  7183. anomalyDesc: "",
  7184. // 照片列表(含 url 和 ossId)
  7185. photoList: [],
  7186. // 是否显示类型选择器
  7187. showTypeSheet: false,
  7188. // 异常类型字典列表(从后端获取)
  7189. anomalyTypes: []
  7190. };
  7191. },
  7192. onLoad(options) {
  7193. if (options.orderId) {
  7194. this.orderId = options.orderId;
  7195. }
  7196. this.loadAnomalyTypes();
  7197. },
  7198. computed: {
  7199. // 当前选中的类型显示文本
  7200. selectedType() {
  7201. return this.selectedTypeLabel || "";
  7202. }
  7203. },
  7204. methods: {
  7205. /**
  7206. * 加载异常类型字典数据
  7207. */
  7208. async loadAnomalyTypes() {
  7209. try {
  7210. const res = await getDictDataByType("flf_anamaly_type");
  7211. if (res.data && Array.isArray(res.data)) {
  7212. this.anomalyTypes = res.data.map((item) => ({
  7213. label: item.dictLabel,
  7214. value: item.dictValue,
  7215. dictCode: item.dictCode
  7216. }));
  7217. formatAppLog("log", "at pages/orders/anomaly.vue:137", "异常类型字典:", this.anomalyTypes);
  7218. }
  7219. } catch (err) {
  7220. formatAppLog("error", "at pages/orders/anomaly.vue:140", "获取异常类型字典失败:", err);
  7221. }
  7222. },
  7223. // 打开类型选择器
  7224. openTypeSheet() {
  7225. this.showTypeSheet = true;
  7226. },
  7227. // 关闭类型选择器
  7228. closeTypeSheet() {
  7229. this.showTypeSheet = false;
  7230. },
  7231. // 选择异常类型
  7232. selectType(type) {
  7233. this.selectedTypeValue = type.value;
  7234. this.selectedTypeLabel = type.label;
  7235. this.closeTypeSheet();
  7236. },
  7237. // 选择照片并上传
  7238. choosePhoto() {
  7239. uni.chooseImage({
  7240. count: 5 - this.photoList.length,
  7241. sizeType: ["compressed"],
  7242. sourceType: ["album", "camera"],
  7243. success: async (res) => {
  7244. uni.showLoading({ title: "上传中..." });
  7245. try {
  7246. for (const filePath of res.tempFilePaths) {
  7247. const uploadRes = await uploadFile(filePath);
  7248. if (uploadRes.code === 200) {
  7249. this.photoList.push({
  7250. url: uploadRes.data.url,
  7251. ossId: uploadRes.data.ossId,
  7252. localPath: filePath
  7253. });
  7254. }
  7255. }
  7256. uni.hideLoading();
  7257. } catch (err) {
  7258. uni.hideLoading();
  7259. formatAppLog("error", "at pages/orders/anomaly.vue:179", "上传失败:", err);
  7260. uni.showToast({ title: "上传失败", icon: "none" });
  7261. }
  7262. }
  7263. });
  7264. },
  7265. // 删除照片
  7266. removePhoto(idx) {
  7267. this.photoList.splice(idx, 1);
  7268. },
  7269. // 提交上报
  7270. async submitAnomaly() {
  7271. if (!this.selectedTypeValue) {
  7272. uni.showToast({ title: "请选择异常类型", icon: "none" });
  7273. return;
  7274. }
  7275. if (this.photoList.length === 0) {
  7276. uni.showToast({ title: "请上传现场照片", icon: "none" });
  7277. return;
  7278. }
  7279. const data = {
  7280. orderId: this.orderId,
  7281. type: this.selectedTypeValue,
  7282. content: this.anomalyDesc,
  7283. photos: this.photoList.map((p) => p.ossId)
  7284. };
  7285. try {
  7286. uni.showLoading({ title: "提交中..." });
  7287. await uploadAnamaly(data);
  7288. uni.hideLoading();
  7289. uni.showToast({ title: "上报成功", icon: "success" });
  7290. setTimeout(() => {
  7291. uni.navigateBack();
  7292. }, 1500);
  7293. } catch (err) {
  7294. uni.hideLoading();
  7295. formatAppLog("error", "at pages/orders/anomaly.vue:215", "异常上报失败:", err);
  7296. uni.showToast({ title: "提交失败,请重试", icon: "none" });
  7297. }
  7298. }
  7299. }
  7300. };
  7301. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  7302. return vue.openBlock(), vue.createElementBlock("view", { class: "anomaly-container" }, [
  7303. vue.createElementVNode("scroll-view", {
  7304. "scroll-y": "",
  7305. class: "anomaly-scroll"
  7306. }, [
  7307. vue.createElementVNode("view", { class: "ano-card" }, [
  7308. vue.createElementVNode("view", { class: "ano-section-title" }, [
  7309. vue.createElementVNode("view", { class: "ano-title-bar" }),
  7310. vue.createElementVNode("text", { class: "ano-title-text" }, "异常类型")
  7311. ]),
  7312. vue.createElementVNode("view", {
  7313. class: "ano-type-row",
  7314. onClick: _cache[0] || (_cache[0] = (...args) => $options.openTypeSheet && $options.openTypeSheet(...args))
  7315. }, [
  7316. vue.createElementVNode(
  7317. "text",
  7318. {
  7319. class: vue.normalizeClass(["ano-type-val", { "placeholder": !$options.selectedType }])
  7320. },
  7321. vue.toDisplayString($options.selectedType || "请选择异常类型"),
  7322. 3
  7323. /* TEXT, CLASS */
  7324. ),
  7325. vue.createElementVNode("image", {
  7326. class: "ano-right-arrow",
  7327. src: _imports_0$2
  7328. })
  7329. ])
  7330. ]),
  7331. vue.createElementVNode("view", { class: "ano-card" }, [
  7332. vue.createElementVNode("view", { class: "ano-section-title" }, [
  7333. vue.createElementVNode("view", { class: "ano-title-bar" }),
  7334. vue.createElementVNode("text", { class: "ano-title-text" }, "异常描述")
  7335. ]),
  7336. vue.withDirectives(vue.createElementVNode(
  7337. "textarea",
  7338. {
  7339. class: "ano-textarea",
  7340. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.anomalyDesc = $event),
  7341. placeholder: "请详细描述现场异常情况...",
  7342. "placeholder-style": "color:#ccc; font-size:28rpx;",
  7343. maxlength: "500"
  7344. },
  7345. null,
  7346. 512
  7347. /* NEED_PATCH */
  7348. ), [
  7349. [vue.vModelText, $data.anomalyDesc]
  7350. ])
  7351. ]),
  7352. vue.createElementVNode("view", { class: "ano-card" }, [
  7353. vue.createElementVNode("view", { class: "ano-section-title" }, [
  7354. vue.createElementVNode("view", { class: "ano-title-bar" }),
  7355. vue.createElementVNode("text", { class: "ano-title-text" }, "现场照片 (必填,最多5张)")
  7356. ]),
  7357. vue.createElementVNode("view", { class: "ano-photo-grid" }, [
  7358. (vue.openBlock(true), vue.createElementBlock(
  7359. vue.Fragment,
  7360. null,
  7361. vue.renderList($data.photoList, (img, idx) => {
  7362. return vue.openBlock(), vue.createElementBlock("view", {
  7363. class: "ano-photo-item",
  7364. key: idx
  7365. }, [
  7366. vue.createElementVNode("image", {
  7367. class: "ano-photo-preview",
  7368. src: img.url || img.localPath || img,
  7369. mode: "aspectFill"
  7370. }, null, 8, ["src"]),
  7371. vue.createElementVNode("view", {
  7372. class: "ano-photo-del",
  7373. onClick: ($event) => $options.removePhoto(idx)
  7374. }, "×", 8, ["onClick"])
  7375. ]);
  7376. }),
  7377. 128
  7378. /* KEYED_FRAGMENT */
  7379. )),
  7380. $data.photoList.length < 5 ? (vue.openBlock(), vue.createElementBlock("view", {
  7381. key: 0,
  7382. class: "ano-photo-add",
  7383. onClick: _cache[2] || (_cache[2] = (...args) => $options.choosePhoto && $options.choosePhoto(...args))
  7384. }, [
  7385. vue.createElementVNode("image", {
  7386. class: "ano-add-icon",
  7387. src: _imports_1$7
  7388. }),
  7389. vue.createElementVNode("text", { class: "ano-add-text" }, "上传")
  7390. ])) : vue.createCommentVNode("v-if", true)
  7391. ])
  7392. ]),
  7393. vue.createElementVNode("view", { style: { "height": "160rpx" } })
  7394. ]),
  7395. vue.createElementVNode("view", { class: "ano-footer" }, [
  7396. vue.createElementVNode("button", {
  7397. class: "ano-submit-btn",
  7398. onClick: _cache[3] || (_cache[3] = (...args) => $options.submitAnomaly && $options.submitAnomaly(...args))
  7399. }, "提交上报")
  7400. ]),
  7401. $data.showTypeSheet ? (vue.openBlock(), vue.createElementBlock("view", {
  7402. key: 0,
  7403. class: "ano-sheet-mask",
  7404. onClick: _cache[6] || (_cache[6] = (...args) => $options.closeTypeSheet && $options.closeTypeSheet(...args))
  7405. }, [
  7406. vue.createElementVNode("view", {
  7407. class: "ano-sheet",
  7408. onClick: _cache[5] || (_cache[5] = vue.withModifiers(() => {
  7409. }, ["stop"]))
  7410. }, [
  7411. vue.createElementVNode("text", { class: "ano-sheet-title" }, "选择异常类型"),
  7412. vue.createElementVNode("scroll-view", {
  7413. "scroll-y": "",
  7414. class: "ano-sheet-list"
  7415. }, [
  7416. (vue.openBlock(true), vue.createElementBlock(
  7417. vue.Fragment,
  7418. null,
  7419. vue.renderList($data.anomalyTypes, (type, idx) => {
  7420. return vue.openBlock(), vue.createElementBlock("view", {
  7421. class: "ano-sheet-item",
  7422. key: idx,
  7423. onClick: ($event) => $options.selectType(type)
  7424. }, [
  7425. vue.createElementVNode(
  7426. "text",
  7427. {
  7428. class: vue.normalizeClass(["ano-sheet-item-text", { "selected": $data.selectedTypeValue === type.value }])
  7429. },
  7430. vue.toDisplayString(type.label),
  7431. 3
  7432. /* TEXT, CLASS */
  7433. ),
  7434. $data.selectedTypeValue === type.value ? (vue.openBlock(), vue.createElementBlock("image", {
  7435. key: 0,
  7436. class: "ano-check-icon",
  7437. src: _imports_0$2
  7438. })) : vue.createCommentVNode("v-if", true)
  7439. ], 8, ["onClick"]);
  7440. }),
  7441. 128
  7442. /* KEYED_FRAGMENT */
  7443. ))
  7444. ]),
  7445. vue.createElementVNode("view", {
  7446. class: "ano-sheet-cancel",
  7447. onClick: _cache[4] || (_cache[4] = (...args) => $options.closeTypeSheet && $options.closeTypeSheet(...args))
  7448. }, "取消")
  7449. ])
  7450. ])) : vue.createCommentVNode("v-if", true)
  7451. ]);
  7452. }
  7453. const PagesOrdersAnomaly = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/orders/anomaly.vue"]]);
  7454. const _sfc_main$p = {
  7455. data() {
  7456. return {
  7457. tabs: ["全部", "已完成", "已拒绝"],
  7458. activeTab: 0,
  7459. stats: {
  7460. total: 0,
  7461. reject: 0,
  7462. reward: 0,
  7463. punish: 0
  7464. },
  7465. orders: [],
  7466. serviceList: [],
  7467. pageNum: 1,
  7468. pageSize: 10,
  7469. total: 0,
  7470. loading: false
  7471. };
  7472. },
  7473. computed: {
  7474. filteredOrders() {
  7475. return this.orders;
  7476. }
  7477. },
  7478. async onLoad() {
  7479. await this.loadServiceList();
  7480. this.fetchStats();
  7481. this.fetchOrders(true);
  7482. },
  7483. methods: {
  7484. async loadServiceList() {
  7485. try {
  7486. const res = await listAllService();
  7487. this.serviceList = res.data || [];
  7488. } catch (err) {
  7489. formatAppLog("error", "at pages/mine/order-stats.vue:161", "获取服务类型失败:", err);
  7490. }
  7491. },
  7492. async fetchStats() {
  7493. try {
  7494. const res = await getOrderStats();
  7495. if (res.code === 200 && res.data) {
  7496. this.stats = {
  7497. ...this.stats,
  7498. ...res.data
  7499. };
  7500. }
  7501. } catch (err) {
  7502. formatAppLog("error", "at pages/mine/order-stats.vue:174", "获取统计值失败:", err);
  7503. }
  7504. },
  7505. async fetchOrders(reset = false) {
  7506. if (reset) {
  7507. this.pageNum = 1;
  7508. this.orders = [];
  7509. }
  7510. if (this.loading)
  7511. return;
  7512. if (!reset && this.orders.length >= this.total && this.total !== 0)
  7513. return;
  7514. this.loading = true;
  7515. try {
  7516. const statusMap = { 0: void 0, 1: 4, 2: 5 };
  7517. const params = {
  7518. status: statusMap[this.activeTab],
  7519. pageNum: this.pageNum,
  7520. pageSize: this.pageSize
  7521. };
  7522. const res = await getStatisticOrders(params);
  7523. if (res.code === 200) {
  7524. this.total = res.total || 0;
  7525. const rows = res.rows || [];
  7526. const mapped = rows.map((item) => this.transformOrder(item));
  7527. this.orders = this.orders.concat(mapped);
  7528. this.pageNum++;
  7529. }
  7530. } catch (err) {
  7531. formatAppLog("error", "at pages/mine/order-stats.vue:202", "获取订单列表失败:", err);
  7532. } finally {
  7533. this.loading = false;
  7534. }
  7535. },
  7536. transformOrder(order) {
  7537. const service = this.serviceList.find((s) => s.id === order.service);
  7538. const mode = (service == null ? void 0 : service.mode) || 0;
  7539. const isRoundTrip = mode === 1;
  7540. const statusMap = {
  7541. 0: { label: "待派单", color: "#f56c6c" },
  7542. 1: { label: "待接单", color: "#e6a23c" },
  7543. 2: { label: "待服务", color: "#49a3ff" },
  7544. 3: { label: "服务中", color: "#49a3ff" },
  7545. 4: { label: "已完成", color: "#67c23a" },
  7546. 5: { label: "已取消", color: "#909399" }
  7547. };
  7548. const statusInfo = statusMap[order.status] || { label: "未知", color: "#999" };
  7549. return {
  7550. id: order.id,
  7551. orderType: isRoundTrip ? 1 : 2,
  7552. typeName: (service == null ? void 0 : service.name) || "未知",
  7553. typeIcon: (service == null ? void 0 : service.iconUrl) || "",
  7554. statusLabel: statusInfo.label,
  7555. statusColor: statusInfo.color,
  7556. finishTime: order.serviceTime || "",
  7557. serviceTime: order.serviceTime || "",
  7558. petName: order.petName || "未知",
  7559. petBreed: order.breed || "未知",
  7560. petAvatar: order.petAvatarUrl || "/static/dog.png",
  7561. price: (order.price / 100).toFixed(2),
  7562. startName: order.fromAddress || "",
  7563. startAddr: order.fromAddress || "",
  7564. endName: (order.customerName || "") + " " + (order.customerPhone || ""),
  7565. endAddr: order.toAddress || "",
  7566. serviceNote: order.remark || ""
  7567. };
  7568. },
  7569. switchTab(idx) {
  7570. this.activeTab = idx;
  7571. this.fetchOrders(true);
  7572. },
  7573. onReachBottom() {
  7574. this.fetchOrders();
  7575. },
  7576. navBack() {
  7577. uni.navigateBack();
  7578. }
  7579. }
  7580. };
  7581. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  7582. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  7583. vue.createElementVNode("view", { class: "stats-banner" }, [
  7584. vue.createElementVNode("view", { class: "banner-item" }, [
  7585. vue.createElementVNode(
  7586. "text",
  7587. { class: "banner-num" },
  7588. vue.toDisplayString($data.stats.total),
  7589. 1
  7590. /* TEXT */
  7591. ),
  7592. vue.createElementVNode("text", { class: "banner-label" }, "累计接单")
  7593. ]),
  7594. vue.createElementVNode("view", { class: "banner-item" }, [
  7595. vue.createElementVNode(
  7596. "text",
  7597. { class: "banner-num" },
  7598. vue.toDisplayString($data.stats.reject),
  7599. 1
  7600. /* TEXT */
  7601. ),
  7602. vue.createElementVNode("text", { class: "banner-label" }, "累计拒单")
  7603. ]),
  7604. vue.createElementVNode("view", { class: "banner-item" }, [
  7605. vue.createElementVNode(
  7606. "text",
  7607. { class: "banner-num" },
  7608. vue.toDisplayString($data.stats.reward),
  7609. 1
  7610. /* TEXT */
  7611. ),
  7612. vue.createElementVNode("text", { class: "banner-label" }, "奖励单量")
  7613. ]),
  7614. vue.createElementVNode("view", { class: "banner-item" }, [
  7615. vue.createElementVNode(
  7616. "text",
  7617. { class: "banner-num" },
  7618. vue.toDisplayString($data.stats.punish),
  7619. 1
  7620. /* TEXT */
  7621. ),
  7622. vue.createElementVNode("text", { class: "banner-label" }, "惩罚单量")
  7623. ])
  7624. ]),
  7625. vue.createElementVNode("view", { class: "tab-bar" }, [
  7626. (vue.openBlock(true), vue.createElementBlock(
  7627. vue.Fragment,
  7628. null,
  7629. vue.renderList($data.tabs, (tab, idx) => {
  7630. return vue.openBlock(), vue.createElementBlock("view", {
  7631. class: vue.normalizeClass(["tab-item", { active: $data.activeTab === idx }]),
  7632. key: idx,
  7633. onClick: ($event) => $options.switchTab(idx)
  7634. }, [
  7635. vue.createElementVNode(
  7636. "text",
  7637. null,
  7638. vue.toDisplayString(tab),
  7639. 1
  7640. /* TEXT */
  7641. ),
  7642. $data.activeTab === idx ? (vue.openBlock(), vue.createElementBlock("view", {
  7643. key: 0,
  7644. class: "tab-line"
  7645. })) : vue.createCommentVNode("v-if", true)
  7646. ], 10, ["onClick"]);
  7647. }),
  7648. 128
  7649. /* KEYED_FRAGMENT */
  7650. ))
  7651. ]),
  7652. vue.createElementVNode(
  7653. "scroll-view",
  7654. {
  7655. "scroll-y": "",
  7656. class: "order-scroll",
  7657. onScrolltolower: _cache[0] || (_cache[0] = (...args) => $options.onReachBottom && $options.onReachBottom(...args))
  7658. },
  7659. [
  7660. vue.createElementVNode("view", { style: { "height": "16rpx" } }),
  7661. (vue.openBlock(true), vue.createElementBlock(
  7662. vue.Fragment,
  7663. null,
  7664. vue.renderList($options.filteredOrders, (order, idx) => {
  7665. return vue.openBlock(), vue.createElementBlock("view", {
  7666. class: "order-card",
  7667. key: idx
  7668. }, [
  7669. vue.createElementVNode("view", { class: "card-header" }, [
  7670. vue.createElementVNode("view", { class: "type-badge" }, [
  7671. vue.createElementVNode("image", {
  7672. class: "type-icon",
  7673. src: order.typeIcon
  7674. }, null, 8, ["src"]),
  7675. vue.createElementVNode(
  7676. "text",
  7677. { class: "type-text" },
  7678. vue.toDisplayString(order.typeName),
  7679. 1
  7680. /* TEXT */
  7681. )
  7682. ]),
  7683. vue.createElementVNode(
  7684. "text",
  7685. {
  7686. class: "status-text",
  7687. style: vue.normalizeStyle({ color: order.statusColor })
  7688. },
  7689. vue.toDisplayString(order.statusLabel),
  7690. 5
  7691. /* TEXT, STYLE */
  7692. )
  7693. ]),
  7694. vue.createElementVNode(
  7695. "text",
  7696. { class: "service-time" },
  7697. "服务时间:" + vue.toDisplayString(order.serviceTime),
  7698. 1
  7699. /* TEXT */
  7700. ),
  7701. vue.createElementVNode("view", { class: "pet-card" }, [
  7702. vue.createElementVNode("image", {
  7703. class: "pet-avatar",
  7704. src: order.petAvatar,
  7705. mode: "aspectFill"
  7706. }, null, 8, ["src"]),
  7707. vue.createElementVNode("view", { class: "pet-info" }, [
  7708. vue.createElementVNode(
  7709. "text",
  7710. { class: "pet-name" },
  7711. vue.toDisplayString(order.petName),
  7712. 1
  7713. /* TEXT */
  7714. ),
  7715. vue.createElementVNode(
  7716. "text",
  7717. { class: "pet-breed" },
  7718. "品种: " + vue.toDisplayString(order.petBreed),
  7719. 1
  7720. /* TEXT */
  7721. )
  7722. ]),
  7723. vue.createElementVNode(
  7724. "text",
  7725. { class: "pet-price" },
  7726. "¥" + vue.toDisplayString(order.price),
  7727. 1
  7728. /* TEXT */
  7729. )
  7730. ]),
  7731. vue.createElementVNode("view", { class: "route-info" }, [
  7732. order.orderType === 1 ? (vue.openBlock(), vue.createElementBlock(
  7733. vue.Fragment,
  7734. { key: 0 },
  7735. [
  7736. vue.createElementVNode("view", { class: "route-item" }, [
  7737. vue.createElementVNode("view", { class: "icon-circle pickup" }, "取"),
  7738. vue.createElementVNode("view", { class: "route-connector" }),
  7739. vue.createElementVNode("view", { class: "address-box" }, [
  7740. vue.createElementVNode(
  7741. "text",
  7742. { class: "addr-title" },
  7743. vue.toDisplayString(order.startName),
  7744. 1
  7745. /* TEXT */
  7746. ),
  7747. vue.createElementVNode(
  7748. "text",
  7749. { class: "addr-desc" },
  7750. vue.toDisplayString(order.startAddr),
  7751. 1
  7752. /* TEXT */
  7753. )
  7754. ])
  7755. ]),
  7756. vue.createElementVNode("view", { class: "route-item" }, [
  7757. vue.createElementVNode("view", { class: "icon-circle deliver" }, "送"),
  7758. vue.createElementVNode("view", { class: "address-box" }, [
  7759. vue.createElementVNode(
  7760. "text",
  7761. { class: "addr-title" },
  7762. vue.toDisplayString(order.endName),
  7763. 1
  7764. /* TEXT */
  7765. ),
  7766. vue.createElementVNode(
  7767. "text",
  7768. { class: "addr-desc" },
  7769. vue.toDisplayString(order.endAddr),
  7770. 1
  7771. /* TEXT */
  7772. )
  7773. ])
  7774. ])
  7775. ],
  7776. 64
  7777. /* STABLE_FRAGMENT */
  7778. )) : (vue.openBlock(), vue.createElementBlock(
  7779. vue.Fragment,
  7780. { key: 1 },
  7781. [
  7782. vue.createElementVNode("view", { class: "route-item" }, [
  7783. vue.createElementVNode("view", { class: "icon-circle service" }, "服"),
  7784. vue.createElementVNode("view", { class: "address-box" }, [
  7785. vue.createElementVNode(
  7786. "text",
  7787. { class: "addr-title" },
  7788. vue.toDisplayString(order.endName),
  7789. 1
  7790. /* TEXT */
  7791. ),
  7792. vue.createElementVNode(
  7793. "text",
  7794. { class: "addr-desc" },
  7795. vue.toDisplayString(order.endAddr),
  7796. 1
  7797. /* TEXT */
  7798. )
  7799. ])
  7800. ]),
  7801. order.serviceNote ? (vue.openBlock(), vue.createElementBlock("view", {
  7802. key: 0,
  7803. class: "service-note-row"
  7804. }, [
  7805. vue.createElementVNode(
  7806. "text",
  7807. { class: "service-note-text" },
  7808. "服务内容:" + vue.toDisplayString(order.serviceNote),
  7809. 1
  7810. /* TEXT */
  7811. )
  7812. ])) : vue.createCommentVNode("v-if", true)
  7813. ],
  7814. 64
  7815. /* STABLE_FRAGMENT */
  7816. ))
  7817. ])
  7818. ]);
  7819. }),
  7820. 128
  7821. /* KEYED_FRAGMENT */
  7822. )),
  7823. $options.filteredOrders.length === 0 && !$data.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  7824. key: 0,
  7825. class: "empty-state"
  7826. }, [
  7827. vue.createElementVNode("text", { class: "empty-text" }, "暂无相关订单")
  7828. ])) : vue.createCommentVNode("v-if", true),
  7829. $data.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  7830. key: 1,
  7831. class: "loading-more"
  7832. }, [
  7833. vue.createElementVNode("text", null, "加载中...")
  7834. ])) : vue.createCommentVNode("v-if", true),
  7835. vue.createElementVNode("view", { style: { "height": "40rpx" } })
  7836. ],
  7837. 32
  7838. /* NEED_HYDRATION */
  7839. )
  7840. ]);
  7841. }
  7842. const PagesMineOrderStats = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/order-stats.vue"]]);
  7843. function getBalanceOnApp() {
  7844. return request({
  7845. url: "/fulfiller/log/balanceOnApp",
  7846. method: "GET"
  7847. });
  7848. }
  7849. function pageBalanceOnApp(data) {
  7850. return request({
  7851. url: "/fulfiller/log/pageBalanceOnApp",
  7852. method: "GET",
  7853. data
  7854. });
  7855. }
  7856. function listBalanceOnApp(data) {
  7857. return request({
  7858. url: "/fulfiller/log/listBalanceOnApp",
  7859. method: "GET",
  7860. data
  7861. });
  7862. }
  7863. function pointsOnApp() {
  7864. return request({
  7865. url: "/fulfiller/log/pointsOnApp",
  7866. method: "GET"
  7867. });
  7868. }
  7869. function pagePointsOnApp(data) {
  7870. return request({
  7871. url: "/fulfiller/log/pagePointsOnApp",
  7872. method: "GET",
  7873. data
  7874. });
  7875. }
  7876. function listPointsOnApp(data) {
  7877. return request({
  7878. url: "/fulfiller/log/listPointsOnApp",
  7879. method: "GET",
  7880. data
  7881. });
  7882. }
  7883. function countOnAppReward(data) {
  7884. return request({
  7885. url: "/fulfiller/log/countOnAppReward",
  7886. method: "GET",
  7887. data
  7888. });
  7889. }
  7890. function listOnAppReward(data) {
  7891. return request({
  7892. url: "/fulfiller/log/listOnAppReward",
  7893. method: "GET",
  7894. data
  7895. });
  7896. }
  7897. const FlfBalanceBizType = {
  7898. admin_reward: "后台奖励",
  7899. admin_punish: "后台惩罚",
  7900. admin_adjust: "后台调整",
  7901. order_reward: "订单奖励",
  7902. order_punish: "订单惩罚",
  7903. order_finish: "订单完成",
  7904. salary: "工资发放",
  7905. withdraw: "提现"
  7906. };
  7907. const FlfPointsBizType = {
  7908. admin_reward: "后台奖励",
  7909. admin_punish: "后台惩罚",
  7910. admin_adjust: "后台调整",
  7911. order_reward: "订单奖励",
  7912. order_punish: "订单惩罚",
  7913. order_finish: "订单完成"
  7914. };
  7915. const FlfRewardBizType = {
  7916. admin_reward: "后台奖励",
  7917. admin_punish: "后台惩罚",
  7918. order_reward: "订单奖励",
  7919. order_punish: "订单惩罚",
  7920. order_finish: "订单完成"
  7921. };
  7922. const FlfActionType = {
  7923. add: "收入",
  7924. reduce: "支出"
  7925. };
  7926. const fulfillerEnum = {
  7927. FlfBalanceBizType,
  7928. FlfPointsBizType,
  7929. FlfRewardBizType,
  7930. FlfActionType
  7931. };
  7932. const bizTypeMap$5 = fulfillerEnum.FlfRewardBizType;
  7933. const _sfc_main$o = {
  7934. data() {
  7935. const now = /* @__PURE__ */ new Date();
  7936. return {
  7937. tabs: ["全部", "奖励", "惩罚"],
  7938. activeTab: 0,
  7939. selectedYear: now.getFullYear(),
  7940. selectedMonth: now.getFullYear() === 2026 && now.getMonth() < 2 ? 3 : now.getMonth() + 1,
  7941. // 默认当前月,处理一下测试数据时间
  7942. // 统计数据
  7943. stats: {
  7944. rewardCount: 0,
  7945. punishCount: 0,
  7946. rewardBalance: 0,
  7947. punishBalance: 0
  7948. },
  7949. // 月份选择器状态
  7950. showMonthPicker: false,
  7951. pickerYear: 2026,
  7952. pickerMonth: 3,
  7953. years: [2024, 2025, 2026],
  7954. months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
  7955. yearScrollTop: 0,
  7956. monthScrollTop: 0,
  7957. // 奖惩记录列表
  7958. records: []
  7959. };
  7960. },
  7961. computed: {
  7962. filteredList() {
  7963. if (this.activeTab === 0)
  7964. return this.records;
  7965. const targetType = this.activeTab === 1 ? "reward" : "penalty";
  7966. return this.records.filter((r) => r.type === targetType);
  7967. }
  7968. },
  7969. onShow() {
  7970. if (this.selectedYear === 2026 && this.selectedMonth === 2)
  7971. ;
  7972. this.fetchData();
  7973. },
  7974. methods: {
  7975. async fetchData() {
  7976. const params = {
  7977. year: this.selectedYear,
  7978. month: this.selectedMonth
  7979. };
  7980. this.fetchStats(params);
  7981. this.fetchList(params);
  7982. },
  7983. async fetchStats(params) {
  7984. try {
  7985. const res = await countOnAppReward(params);
  7986. if (res.code === 200) {
  7987. this.stats = res.data || {
  7988. rewardCount: 0,
  7989. punishCount: 0,
  7990. rewardBalance: 0,
  7991. punishBalance: 0
  7992. };
  7993. }
  7994. } catch (err) {
  7995. formatAppLog("error", "at pages/mine/rewards.vue:196", "获取奖惩统计失败:", err);
  7996. }
  7997. },
  7998. async fetchList(params) {
  7999. try {
  8000. const res = await listOnAppReward(params);
  8001. if (res.code === 200) {
  8002. const list = res.data || [];
  8003. this.records = list.map((item) => {
  8004. const isAdd = item.type === "add";
  8005. const amountVal = Math.abs(item.amount) / 100;
  8006. let dateStr = "";
  8007. if (item.createTime) {
  8008. const datePart = item.createTime.split(" ")[0];
  8009. const parts = datePart.split("-");
  8010. if (parts.length >= 3) {
  8011. dateStr = `${parts[1]}-${parts[2]}`;
  8012. }
  8013. }
  8014. return {
  8015. ...item,
  8016. date: dateStr,
  8017. title: bizTypeMap$5[item.bizType] || item.bizType || "其他",
  8018. desc: item.reason || "",
  8019. amount: isAdd ? amountVal : -amountVal,
  8020. type: isAdd ? "reward" : "penalty",
  8021. status: isAdd ? "已入账" : "已扣款",
  8022. // 简化处理状态
  8023. statusClass: isAdd ? "credited" : "deducted"
  8024. };
  8025. });
  8026. }
  8027. } catch (err) {
  8028. formatAppLog("error", "at pages/mine/rewards.vue:231", "获取奖惩列表失败:", err);
  8029. }
  8030. },
  8031. switchTab(idx) {
  8032. this.activeTab = idx;
  8033. },
  8034. openMonthPicker() {
  8035. this.pickerYear = this.selectedYear;
  8036. this.pickerMonth = this.selectedMonth;
  8037. this.showMonthPicker = true;
  8038. },
  8039. closeMonthPicker() {
  8040. this.showMonthPicker = false;
  8041. },
  8042. confirmMonthPicker() {
  8043. this.selectedYear = this.pickerYear;
  8044. this.selectedMonth = this.pickerMonth;
  8045. this.closeMonthPicker();
  8046. this.fetchData();
  8047. },
  8048. goToAll() {
  8049. uni.navigateTo({ url: "/pages/mine/rewards-all" });
  8050. }
  8051. }
  8052. };
  8053. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  8054. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  8055. vue.createElementVNode("view", { class: "top-banner" }, [
  8056. vue.createElementVNode("view", {
  8057. class: "month-btn",
  8058. onClick: _cache[0] || (_cache[0] = (...args) => $options.openMonthPicker && $options.openMonthPicker(...args))
  8059. }, [
  8060. vue.createElementVNode(
  8061. "text",
  8062. { class: "month-text" },
  8063. vue.toDisplayString($data.selectedYear) + "年" + vue.toDisplayString($data.selectedMonth) + "月 ▾",
  8064. 1
  8065. /* TEXT */
  8066. )
  8067. ]),
  8068. vue.createElementVNode("view", { class: "stats-grid" }, [
  8069. vue.createElementVNode("view", { class: "stats-cell" }, [
  8070. vue.createElementVNode("text", { class: "stats-label" }, "奖励订单"),
  8071. vue.createElementVNode("text", { class: "stats-num" }, [
  8072. vue.createTextVNode(
  8073. vue.toDisplayString($data.stats.rewardCount),
  8074. 1
  8075. /* TEXT */
  8076. ),
  8077. vue.createElementVNode("text", { class: "stats-unit" }, "单")
  8078. ]),
  8079. vue.createElementVNode("view", { class: "stats-divider" }),
  8080. vue.createElementVNode("text", { class: "stats-sub" }, "月度统计")
  8081. ]),
  8082. vue.createElementVNode("view", { class: "stats-cell" }, [
  8083. vue.createElementVNode("text", { class: "stats-label" }, "惩罚订单"),
  8084. vue.createElementVNode("text", { class: "stats-num" }, [
  8085. vue.createTextVNode(
  8086. vue.toDisplayString($data.stats.punishCount),
  8087. 1
  8088. /* TEXT */
  8089. ),
  8090. vue.createElementVNode("text", { class: "stats-unit" }, "单")
  8091. ]),
  8092. vue.createElementVNode("view", { class: "stats-divider" }),
  8093. vue.createElementVNode("text", { class: "stats-sub" }, "月度统计")
  8094. ]),
  8095. vue.createElementVNode("view", { class: "stats-cell" }, [
  8096. vue.createElementVNode("text", { class: "stats-label" }, "奖励金额"),
  8097. vue.createElementVNode(
  8098. "text",
  8099. { class: "stats-num reward-num" },
  8100. vue.toDisplayString(($data.stats.rewardBalance / 100).toFixed(2)),
  8101. 1
  8102. /* TEXT */
  8103. ),
  8104. vue.createElementVNode("view", { class: "stats-divider" }),
  8105. vue.createElementVNode("text", { class: "stats-sub" }, "月度统计")
  8106. ]),
  8107. vue.createElementVNode("view", { class: "stats-cell" }, [
  8108. vue.createElementVNode("text", { class: "stats-label" }, "惩罚金额"),
  8109. vue.createElementVNode(
  8110. "text",
  8111. { class: "stats-num penalty-num" },
  8112. vue.toDisplayString(($data.stats.punishBalance / 100).toFixed(2)),
  8113. 1
  8114. /* TEXT */
  8115. ),
  8116. vue.createElementVNode("view", { class: "stats-divider" }),
  8117. vue.createElementVNode("text", { class: "stats-sub" }, "月度统计")
  8118. ])
  8119. ])
  8120. ]),
  8121. vue.createElementVNode("view", { class: "list-header" }, [
  8122. vue.createElementVNode("view", { class: "tab-bar" }, [
  8123. (vue.openBlock(true), vue.createElementBlock(
  8124. vue.Fragment,
  8125. null,
  8126. vue.renderList($data.tabs, (tab, idx) => {
  8127. return vue.openBlock(), vue.createElementBlock("view", {
  8128. class: vue.normalizeClass(["tab-item", { active: $data.activeTab === idx }]),
  8129. key: idx,
  8130. onClick: ($event) => $options.switchTab(idx)
  8131. }, [
  8132. vue.createElementVNode(
  8133. "text",
  8134. null,
  8135. vue.toDisplayString(tab),
  8136. 1
  8137. /* TEXT */
  8138. ),
  8139. $data.activeTab === idx ? (vue.openBlock(), vue.createElementBlock("view", {
  8140. key: 0,
  8141. class: "tab-line"
  8142. })) : vue.createCommentVNode("v-if", true)
  8143. ], 10, ["onClick"]);
  8144. }),
  8145. 128
  8146. /* KEYED_FRAGMENT */
  8147. ))
  8148. ]),
  8149. vue.createElementVNode("view", {
  8150. class: "view-all-btn",
  8151. onClick: _cache[1] || (_cache[1] = (...args) => $options.goToAll && $options.goToAll(...args))
  8152. }, [
  8153. vue.createElementVNode("text", { class: "view-all-text" }, "查看全部 ›")
  8154. ])
  8155. ]),
  8156. vue.createElementVNode("view", { class: "record-list" }, [
  8157. (vue.openBlock(true), vue.createElementBlock(
  8158. vue.Fragment,
  8159. null,
  8160. vue.renderList($options.filteredList, (item, idx) => {
  8161. return vue.openBlock(), vue.createElementBlock("view", {
  8162. class: "record-item",
  8163. key: idx
  8164. }, [
  8165. vue.createElementVNode(
  8166. "view",
  8167. {
  8168. class: vue.normalizeClass(["ri-icon", item.amount > 0 ? "ri-reward" : "ri-penalty"])
  8169. },
  8170. [
  8171. vue.createElementVNode("text", { class: "ri-icon-text" }, "¥")
  8172. ],
  8173. 2
  8174. /* CLASS */
  8175. ),
  8176. vue.createElementVNode("view", { class: "ri-content" }, [
  8177. vue.createElementVNode("view", { class: "ri-title-row" }, [
  8178. vue.createElementVNode(
  8179. "text",
  8180. { class: "ri-date" },
  8181. vue.toDisplayString(item.date),
  8182. 1
  8183. /* TEXT */
  8184. ),
  8185. vue.createElementVNode(
  8186. "text",
  8187. { class: "ri-title" },
  8188. vue.toDisplayString(item.title),
  8189. 1
  8190. /* TEXT */
  8191. )
  8192. ]),
  8193. vue.createElementVNode(
  8194. "text",
  8195. { class: "ri-desc" },
  8196. vue.toDisplayString(item.desc),
  8197. 1
  8198. /* TEXT */
  8199. )
  8200. ]),
  8201. vue.createElementVNode("view", { class: "ri-right" }, [
  8202. vue.createElementVNode(
  8203. "text",
  8204. {
  8205. class: vue.normalizeClass(["ri-amount", item.amount > 0 ? "positive" : "negative"])
  8206. },
  8207. vue.toDisplayString(item.amount > 0 ? "+" : "") + vue.toDisplayString(item.amount.toFixed(2)),
  8208. 3
  8209. /* TEXT, CLASS */
  8210. ),
  8211. vue.createElementVNode(
  8212. "text",
  8213. {
  8214. class: vue.normalizeClass(["ri-status", item.statusClass])
  8215. },
  8216. vue.toDisplayString(item.status),
  8217. 3
  8218. /* TEXT, CLASS */
  8219. )
  8220. ])
  8221. ]);
  8222. }),
  8223. 128
  8224. /* KEYED_FRAGMENT */
  8225. )),
  8226. vue.createElementVNode("text", { class: "more-hint" }, "更多记录请点击上方的查看全部")
  8227. ]),
  8228. $data.showMonthPicker ? (vue.openBlock(), vue.createElementBlock("view", {
  8229. key: 0,
  8230. class: "picker-mask",
  8231. onClick: _cache[7] || (_cache[7] = (...args) => $options.closeMonthPicker && $options.closeMonthPicker(...args))
  8232. }, [
  8233. vue.createElementVNode("view", {
  8234. class: "picker-sheet",
  8235. onClick: _cache[6] || (_cache[6] = vue.withModifiers(() => {
  8236. }, ["stop"]))
  8237. }, [
  8238. vue.createElementVNode("view", { class: "picker-header" }, [
  8239. vue.createElementVNode("text", {
  8240. class: "picker-cancel",
  8241. onClick: _cache[2] || (_cache[2] = (...args) => $options.closeMonthPicker && $options.closeMonthPicker(...args))
  8242. }, "取消"),
  8243. vue.createElementVNode("text", { class: "picker-title" }, "选择时间"),
  8244. vue.createElementVNode("text", {
  8245. class: "picker-confirm",
  8246. onClick: _cache[3] || (_cache[3] = (...args) => $options.confirmMonthPicker && $options.confirmMonthPicker(...args))
  8247. }, "确定")
  8248. ]),
  8249. vue.createElementVNode("view", { class: "picker-body" }, [
  8250. vue.createElementVNode("scroll-view", {
  8251. "scroll-y": "",
  8252. class: "picker-column",
  8253. "scroll-top": $data.yearScrollTop,
  8254. onScroll: _cache[4] || (_cache[4] = (...args) => _ctx.onYearScroll && _ctx.onYearScroll(...args))
  8255. }, [
  8256. vue.createElementVNode("view", { style: { "height": "80rpx" } }),
  8257. (vue.openBlock(true), vue.createElementBlock(
  8258. vue.Fragment,
  8259. null,
  8260. vue.renderList($data.years, (year) => {
  8261. return vue.openBlock(), vue.createElementBlock("view", {
  8262. class: vue.normalizeClass(["picker-col-item", { "picker-selected": $data.pickerYear === year }]),
  8263. key: year,
  8264. onClick: ($event) => $data.pickerYear = year
  8265. }, vue.toDisplayString(year) + "年", 11, ["onClick"]);
  8266. }),
  8267. 128
  8268. /* KEYED_FRAGMENT */
  8269. )),
  8270. vue.createElementVNode("view", { style: { "height": "80rpx" } })
  8271. ], 40, ["scroll-top"]),
  8272. vue.createElementVNode("view", { class: "picker-highlight" }),
  8273. vue.createElementVNode("scroll-view", {
  8274. "scroll-y": "",
  8275. class: "picker-column",
  8276. "scroll-top": $data.monthScrollTop,
  8277. onScroll: _cache[5] || (_cache[5] = (...args) => _ctx.onMonthScroll && _ctx.onMonthScroll(...args))
  8278. }, [
  8279. vue.createElementVNode("view", { style: { "height": "80rpx" } }),
  8280. (vue.openBlock(true), vue.createElementBlock(
  8281. vue.Fragment,
  8282. null,
  8283. vue.renderList($data.months, (month) => {
  8284. return vue.openBlock(), vue.createElementBlock("view", {
  8285. class: vue.normalizeClass(["picker-col-item", { "picker-selected": $data.pickerMonth === month }]),
  8286. key: month,
  8287. onClick: ($event) => $data.pickerMonth = month
  8288. }, vue.toDisplayString(month) + "月", 11, ["onClick"]);
  8289. }),
  8290. 128
  8291. /* KEYED_FRAGMENT */
  8292. )),
  8293. vue.createElementVNode("view", { style: { "height": "80rpx" } })
  8294. ], 40, ["scroll-top"])
  8295. ])
  8296. ])
  8297. ])) : vue.createCommentVNode("v-if", true)
  8298. ]);
  8299. }
  8300. const PagesMineRewards = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/rewards.vue"]]);
  8301. const bizTypeMap$4 = fulfillerEnum.FlfRewardBizType;
  8302. const _sfc_main$n = {
  8303. data() {
  8304. const now = /* @__PURE__ */ new Date();
  8305. return {
  8306. tabs: ["全部", "奖励", "惩罚"],
  8307. activeTab: 0,
  8308. selectedYear: now.getFullYear(),
  8309. selectedMonth: now.getMonth() + 1,
  8310. // 原始分组数据
  8311. allGroups: [],
  8312. loading: false
  8313. };
  8314. },
  8315. computed: {
  8316. currentPickerDate() {
  8317. return `${this.selectedYear}-${String(this.selectedMonth).padStart(2, "0")}`;
  8318. },
  8319. filteredGroups() {
  8320. if (this.activeTab === 0)
  8321. return this.allGroups;
  8322. const typeKey = this.activeTab === 1 ? "reward" : "penalty";
  8323. return this.allGroups.map((g) => ({
  8324. ...g,
  8325. items: g.items.filter((i) => i.type === typeKey)
  8326. })).filter((g) => g.items.length > 0);
  8327. }
  8328. },
  8329. onShow() {
  8330. this.fetchMonthData();
  8331. },
  8332. methods: {
  8333. async fetchMonthData() {
  8334. if (this.loading)
  8335. return;
  8336. this.loading = true;
  8337. try {
  8338. const params = {
  8339. year: this.selectedYear,
  8340. month: this.selectedMonth
  8341. };
  8342. const res = await listOnAppReward(params);
  8343. const data = res.data || [];
  8344. if (data.length === 0) {
  8345. this.allGroups = [];
  8346. return;
  8347. }
  8348. let credited = 0;
  8349. const items = data.map((item) => {
  8350. const isAdd = item.type === "add";
  8351. const amountVal = Math.abs(item.amount) / 100;
  8352. if (isAdd)
  8353. credited += amountVal;
  8354. let dateStr = "";
  8355. if (item.createTime) {
  8356. const datePart = item.createTime.split(" ")[0];
  8357. const parts = datePart.split("-");
  8358. if (parts.length >= 3) {
  8359. dateStr = `${parts[1]}-${parts[2]}`;
  8360. }
  8361. }
  8362. return {
  8363. ...item,
  8364. date: dateStr,
  8365. title: bizTypeMap$4[item.bizType] || item.bizType || "其他",
  8366. desc: item.reason || "",
  8367. amount: isAdd ? amountVal : -amountVal,
  8368. type: isAdd ? "reward" : "penalty",
  8369. status: isAdd ? "已入账" : "已扣款",
  8370. statusClass: isAdd ? "credited" : "deducted"
  8371. };
  8372. });
  8373. this.allGroups = [{
  8374. month: this.selectedMonth,
  8375. year: this.selectedYear,
  8376. credited,
  8377. pending: 0,
  8378. items
  8379. }];
  8380. } catch (err) {
  8381. formatAppLog("error", "at pages/mine/rewards-all.vue:151", "获取奖惩明细失败:", err);
  8382. } finally {
  8383. this.loading = false;
  8384. }
  8385. },
  8386. onDateChange(e) {
  8387. const val = e.detail.value;
  8388. const parts = val.split("-");
  8389. this.selectedYear = parseInt(parts[0]);
  8390. this.selectedMonth = parseInt(parts[1]);
  8391. this.fetchMonthData();
  8392. },
  8393. switchTab(idx) {
  8394. this.activeTab = idx;
  8395. }
  8396. }
  8397. };
  8398. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  8399. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  8400. vue.createElementVNode("view", { class: "filter-header" }, [
  8401. vue.createElementVNode("view", { class: "tab-bar" }, [
  8402. (vue.openBlock(true), vue.createElementBlock(
  8403. vue.Fragment,
  8404. null,
  8405. vue.renderList($data.tabs, (tab, idx) => {
  8406. return vue.openBlock(), vue.createElementBlock("view", {
  8407. class: vue.normalizeClass(["tab-item", { active: $data.activeTab === idx }]),
  8408. key: idx,
  8409. onClick: ($event) => $options.switchTab(idx)
  8410. }, [
  8411. vue.createElementVNode(
  8412. "text",
  8413. null,
  8414. vue.toDisplayString(tab),
  8415. 1
  8416. /* TEXT */
  8417. ),
  8418. $data.activeTab === idx ? (vue.openBlock(), vue.createElementBlock("view", {
  8419. key: 0,
  8420. class: "tab-line"
  8421. })) : vue.createCommentVNode("v-if", true)
  8422. ], 10, ["onClick"]);
  8423. }),
  8424. 128
  8425. /* KEYED_FRAGMENT */
  8426. ))
  8427. ]),
  8428. vue.createElementVNode("view", { class: "date-filter" }, [
  8429. vue.createElementVNode("picker", {
  8430. mode: "date",
  8431. fields: "month",
  8432. value: $options.currentPickerDate,
  8433. onChange: _cache[0] || (_cache[0] = (...args) => $options.onDateChange && $options.onDateChange(...args))
  8434. }, [
  8435. vue.createElementVNode("view", { class: "picker-trigger" }, [
  8436. vue.createElementVNode(
  8437. "text",
  8438. null,
  8439. vue.toDisplayString($data.selectedYear) + "年" + vue.toDisplayString(String($data.selectedMonth).padStart(2, "0")) + "月",
  8440. 1
  8441. /* TEXT */
  8442. ),
  8443. vue.createElementVNode("text", { class: "arrow-icon" }, "▼")
  8444. ])
  8445. ], 40, ["value"])
  8446. ])
  8447. ]),
  8448. vue.createElementVNode("scroll-view", {
  8449. "scroll-y": "",
  8450. class: "main-scroll"
  8451. }, [
  8452. (vue.openBlock(true), vue.createElementBlock(
  8453. vue.Fragment,
  8454. null,
  8455. vue.renderList($options.filteredGroups, (group, gIdx) => {
  8456. return vue.openBlock(), vue.createElementBlock("view", {
  8457. key: gIdx,
  8458. class: "month-group"
  8459. }, [
  8460. vue.createElementVNode("view", { class: "month-header" }, [
  8461. vue.createElementVNode(
  8462. "text",
  8463. { class: "month-title" },
  8464. vue.toDisplayString(group.month) + "月",
  8465. 1
  8466. /* TEXT */
  8467. ),
  8468. vue.createElementVNode("view", { class: "month-summary" }, [
  8469. vue.createElementVNode(
  8470. "text",
  8471. { class: "month-sum-text" },
  8472. "已入账¥" + vue.toDisplayString(group.credited.toFixed(2)),
  8473. 1
  8474. /* TEXT */
  8475. ),
  8476. vue.createElementVNode(
  8477. "text",
  8478. { class: "month-sum-text" },
  8479. " 待入账¥" + vue.toDisplayString(group.pending.toFixed(2)),
  8480. 1
  8481. /* TEXT */
  8482. )
  8483. ])
  8484. ]),
  8485. (vue.openBlock(true), vue.createElementBlock(
  8486. vue.Fragment,
  8487. null,
  8488. vue.renderList(group.items, (item, rIdx) => {
  8489. return vue.openBlock(), vue.createElementBlock("view", {
  8490. class: "record-item",
  8491. key: rIdx
  8492. }, [
  8493. vue.createElementVNode(
  8494. "view",
  8495. {
  8496. class: vue.normalizeClass(["ri-icon", item.amount > 0 ? "ri-reward" : "ri-penalty"])
  8497. },
  8498. [
  8499. vue.createElementVNode("text", { class: "ri-icon-text" }, "¥")
  8500. ],
  8501. 2
  8502. /* CLASS */
  8503. ),
  8504. vue.createElementVNode("view", { class: "ri-content" }, [
  8505. vue.createElementVNode("view", { class: "ri-title-row" }, [
  8506. vue.createElementVNode(
  8507. "text",
  8508. { class: "ri-date" },
  8509. vue.toDisplayString(item.date),
  8510. 1
  8511. /* TEXT */
  8512. ),
  8513. vue.createElementVNode(
  8514. "text",
  8515. { class: "ri-title" },
  8516. vue.toDisplayString(item.title),
  8517. 1
  8518. /* TEXT */
  8519. )
  8520. ]),
  8521. vue.createElementVNode(
  8522. "text",
  8523. { class: "ri-desc" },
  8524. vue.toDisplayString(item.desc),
  8525. 1
  8526. /* TEXT */
  8527. )
  8528. ]),
  8529. vue.createElementVNode("view", { class: "ri-right" }, [
  8530. vue.createElementVNode(
  8531. "text",
  8532. {
  8533. class: vue.normalizeClass(["ri-amount", item.amount > 0 ? "positive" : "negative"])
  8534. },
  8535. vue.toDisplayString(item.amount > 0 ? "+" : "") + vue.toDisplayString(item.amount.toFixed(2)),
  8536. 3
  8537. /* TEXT, CLASS */
  8538. ),
  8539. vue.createElementVNode(
  8540. "text",
  8541. {
  8542. class: vue.normalizeClass(["ri-status", item.statusClass])
  8543. },
  8544. vue.toDisplayString(item.status),
  8545. 3
  8546. /* TEXT, CLASS */
  8547. )
  8548. ])
  8549. ]);
  8550. }),
  8551. 128
  8552. /* KEYED_FRAGMENT */
  8553. ))
  8554. ]);
  8555. }),
  8556. 128
  8557. /* KEYED_FRAGMENT */
  8558. )),
  8559. vue.createElementVNode("view", { style: { "height": "40rpx" } })
  8560. ])
  8561. ]);
  8562. }
  8563. const PagesMineRewardsAll = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/rewards-all.vue"]]);
  8564. function listAllLevelConfigs() {
  8565. return request({
  8566. url: "/fulfiller/levelConfig/listAll",
  8567. method: "GET"
  8568. });
  8569. }
  8570. function getCustomerServiceSetting(id) {
  8571. return request({
  8572. url: "/system/customerServiceSetting/" + id,
  8573. method: "get"
  8574. });
  8575. }
  8576. const logic = {
  8577. components: {
  8578. customTabbar
  8579. },
  8580. data() {
  8581. return {
  8582. showServicePopup: false,
  8583. showLogoutPopup: false,
  8584. profile: null,
  8585. profileLoading: false,
  8586. levelConfigs: [],
  8587. // 等级配置列表
  8588. customerSetting: {
  8589. wechatAccount: "",
  8590. phoneNumber: "400-123-4567",
  8591. qrCodeUrl: "/static/logo.png",
  8592. enterpriseWechatLink: "",
  8593. startServiceTime: "",
  8594. endServiceTime: ""
  8595. }
  8596. };
  8597. },
  8598. computed: {
  8599. // 根据 profile.level 匹配对应的等级名称
  8600. displayLevelName() {
  8601. if (!this.profile || !this.levelConfigs.length)
  8602. return "普通履约者";
  8603. const config = this.levelConfigs.find((c) => c.lvNo === this.profile.level);
  8604. return config ? config.name : this.profile.levelName || "普通履约者";
  8605. }
  8606. },
  8607. onShow() {
  8608. uni.hideTabBar();
  8609. if (isLoggedIn()) {
  8610. this.loadProfile();
  8611. this.loadLevelConfigs();
  8612. this.fetchCustomerServiceSetting();
  8613. }
  8614. },
  8615. methods: {
  8616. async loadProfile() {
  8617. if (this.profileLoading)
  8618. return;
  8619. this.profileLoading = true;
  8620. try {
  8621. const res = await getMyProfile();
  8622. this.profile = res.data || null;
  8623. } catch (err) {
  8624. formatAppLog("error", "at pages/mine/logic.js:53", "获取个人信息失败:", err);
  8625. } finally {
  8626. this.profileLoading = false;
  8627. }
  8628. },
  8629. async loadLevelConfigs() {
  8630. try {
  8631. const res = await listAllLevelConfigs();
  8632. this.levelConfigs = res.data || [];
  8633. } catch (err) {
  8634. formatAppLog("error", "at pages/mine/logic.js:63", "加载等级配置失败:", err);
  8635. }
  8636. },
  8637. async fetchCustomerServiceSetting() {
  8638. try {
  8639. const res = await getCustomerServiceSetting(1);
  8640. if (res.code === 200 && res.data) {
  8641. this.customerSetting = { ...this.customerSetting, ...res.data };
  8642. }
  8643. } catch (err) {
  8644. formatAppLog("error", "at pages/mine/logic.js:73", "获取客服配置失败:", err);
  8645. }
  8646. },
  8647. navToSettings() {
  8648. uni.navigateTo({
  8649. url: "/pages/mine/settings/index"
  8650. });
  8651. },
  8652. navToProfile() {
  8653. uni.navigateTo({
  8654. url: "/pages/mine/settings/profile/index"
  8655. });
  8656. },
  8657. navToLevel() {
  8658. uni.navigateTo({
  8659. url: "/pages/mine/level/index"
  8660. });
  8661. },
  8662. navToNotification() {
  8663. uni.navigateTo({
  8664. url: "/pages/mine/message/index"
  8665. });
  8666. },
  8667. navToWallet() {
  8668. uni.navigateTo({
  8669. url: "/pages/mine/wallet/index"
  8670. });
  8671. },
  8672. navToPoints() {
  8673. uni.navigateTo({
  8674. url: "/pages/mine/points/index"
  8675. });
  8676. },
  8677. navToOrderStats() {
  8678. uni.navigateTo({
  8679. url: "/pages/mine/order-stats"
  8680. });
  8681. },
  8682. navToRewards() {
  8683. uni.navigateTo({
  8684. url: "/pages/mine/rewards"
  8685. });
  8686. },
  8687. openServicePopup() {
  8688. this.showServicePopup = true;
  8689. },
  8690. closeServicePopup() {
  8691. this.showServicePopup = false;
  8692. },
  8693. previewQRCode() {
  8694. if (!this.customerSetting.qrCodeUrl)
  8695. return;
  8696. uni.previewImage({
  8697. urls: [this.customerSetting.qrCodeUrl]
  8698. });
  8699. },
  8700. openOnlineService() {
  8701. if (this.customerSetting.enterpriseWechatLink) {
  8702. uni.setClipboardData({
  8703. data: this.customerSetting.wechatAccount || this.customerSetting.enterpriseWechatLink,
  8704. success: () => {
  8705. uni.showToast({ title: "链接已复制,请在浏览器或微信打开", icon: "none" });
  8706. }
  8707. });
  8708. } else {
  8709. uni.showToast({
  8710. title: "在线客服暂未配置",
  8711. icon: "none"
  8712. });
  8713. }
  8714. },
  8715. callServicePhone() {
  8716. if (!this.customerSetting.phoneNumber) {
  8717. uni.showToast({ title: "暂无联系电话", icon: "none" });
  8718. return;
  8719. }
  8720. uni.makePhoneCall({
  8721. phoneNumber: this.customerSetting.phoneNumber
  8722. });
  8723. },
  8724. logout() {
  8725. this.showLogoutPopup = true;
  8726. },
  8727. cancelLogout() {
  8728. this.showLogoutPopup = false;
  8729. },
  8730. async confirmLogout() {
  8731. this.showLogoutPopup = false;
  8732. try {
  8733. await logout();
  8734. } catch (e) {
  8735. }
  8736. clearAuth();
  8737. uni.reLaunch({
  8738. url: "/pages/login/login"
  8739. });
  8740. }
  8741. }
  8742. };
  8743. const _imports_0$1 = "/static/icons/motorbike.svg";
  8744. const _imports_1$6 = "/static/icons/location.svg";
  8745. const _imports_0 = "/static/icons/chevron_right_dark.svg";
  8746. const _imports_3$1 = "/static/icons/calendar.svg";
  8747. const _imports_4 = "/static/icons/settings.svg";
  8748. const _imports_1$5 = "/static/icons/crown.svg";
  8749. const _imports_6 = "/static/icons/chevron_right_gold.svg";
  8750. const _imports_3 = "/static/icons/chevron_right.svg";
  8751. const _imports_8 = "/static/icons/money_linear.svg";
  8752. const _imports_9 = "/static/icons/headset_linear.svg";
  8753. const _imports_10 = "/static/icons/close_gray.svg";
  8754. const _imports_11 = "/static/icons/headset_green.svg";
  8755. const _imports_13 = "/static/icons/phone_green.svg";
  8756. const _sfc_main$m = {
  8757. ...logic
  8758. };
  8759. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  8760. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
  8761. const _component_custom_tabbar = vue.resolveComponent("custom-tabbar");
  8762. return vue.openBlock(), vue.createElementBlock(
  8763. vue.Fragment,
  8764. null,
  8765. [
  8766. vue.createElementVNode("view", { class: "container" }, [
  8767. vue.createElementVNode("view", { class: "nav-bg" }, [
  8768. vue.createElementVNode("view", { class: "bg-circle-1" }),
  8769. vue.createElementVNode("view", { class: "bg-circle-2" })
  8770. ]),
  8771. vue.createElementVNode("view", { class: "header-section" }, [
  8772. vue.createElementVNode("view", { class: "title-bar" }, "个人中心"),
  8773. vue.createElementVNode("view", {
  8774. class: "user-card",
  8775. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.navToProfile && _ctx.navToProfile(...args))
  8776. }, [
  8777. vue.createElementVNode("image", {
  8778. class: "avatar",
  8779. src: ((_a = _ctx.profile) == null ? void 0 : _a.avatarUrl) || "/static/touxiang.png",
  8780. mode: "aspectFill"
  8781. }, null, 8, ["src"]),
  8782. vue.createElementVNode("view", { class: "info-content" }, [
  8783. vue.createElementVNode("view", { class: "name-row" }, [
  8784. vue.createElementVNode(
  8785. "text",
  8786. { class: "name" },
  8787. vue.toDisplayString(((_b = _ctx.profile) == null ? void 0 : _b.name) || "未登录"),
  8788. 1
  8789. /* TEXT */
  8790. ),
  8791. vue.createElementVNode("view", { class: "tags" }, [
  8792. ((_c = _ctx.profile) == null ? void 0 : _c.status) === "0" ? (vue.openBlock(), vue.createElementBlock("view", {
  8793. key: 0,
  8794. class: "tag green"
  8795. }, "接单中")) : ((_d = _ctx.profile) == null ? void 0 : _d.status) === "1" ? (vue.openBlock(), vue.createElementBlock("view", {
  8796. key: 1,
  8797. class: "tag green"
  8798. }, "休息中")) : ((_e = _ctx.profile) == null ? void 0 : _e.status) === "2" ? (vue.openBlock(), vue.createElementBlock("view", {
  8799. key: 2,
  8800. class: "tag",
  8801. style: { "background": "#eee", "color": "#999" }
  8802. }, "已禁用")) : vue.createCommentVNode("v-if", true),
  8803. ((_f = _ctx.profile) == null ? void 0 : _f.workType) === "full_time" ? (vue.openBlock(), vue.createElementBlock("view", {
  8804. key: 3,
  8805. class: "tag blue"
  8806. }, "全职")) : vue.createCommentVNode("v-if", true),
  8807. vue.createElementVNode("image", {
  8808. class: "bike-icon",
  8809. src: _imports_0$1
  8810. })
  8811. ])
  8812. ]),
  8813. vue.createElementVNode("view", { class: "detail-row" }, [
  8814. vue.createElementVNode("image", {
  8815. class: "small-icon",
  8816. src: _imports_1$6
  8817. }),
  8818. vue.createElementVNode(
  8819. "text",
  8820. null,
  8821. vue.toDisplayString(((_g = _ctx.profile) == null ? void 0 : _g.stationName) || ((_h = _ctx.profile) == null ? void 0 : _h.cityName) || "暂无站点"),
  8822. 1
  8823. /* TEXT */
  8824. ),
  8825. vue.createElementVNode("image", {
  8826. class: "arrow-icon-small",
  8827. src: _imports_0
  8828. })
  8829. ]),
  8830. vue.createElementVNode("view", { class: "detail-row" }, [
  8831. vue.createElementVNode("image", {
  8832. class: "small-icon",
  8833. src: _imports_3$1
  8834. }),
  8835. vue.createElementVNode(
  8836. "text",
  8837. null,
  8838. "已注册" + vue.toDisplayString(((_i = _ctx.profile) == null ? void 0 : _i.registerDays) || 0) + "天",
  8839. 1
  8840. /* TEXT */
  8841. )
  8842. ])
  8843. ]),
  8844. vue.createElementVNode("image", {
  8845. class: "settings-icon",
  8846. src: _imports_4,
  8847. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => _ctx.navToSettings && _ctx.navToSettings(...args), ["stop"]))
  8848. })
  8849. ]),
  8850. vue.createElementVNode("view", { class: "vip-card" }, [
  8851. vue.createElementVNode("view", { class: "vip-left" }, [
  8852. vue.createElementVNode("image", {
  8853. class: "vip-icon",
  8854. src: _imports_1$5
  8855. }),
  8856. vue.createElementVNode("view", { class: "vip-text" }, [
  8857. vue.createElementVNode(
  8858. "text",
  8859. { class: "vip-title" },
  8860. vue.toDisplayString(_ctx.displayLevelName),
  8861. 1
  8862. /* TEXT */
  8863. ),
  8864. vue.createElementVNode("text", { class: "vip-desc" }, "完成更多订单即可升级")
  8865. ])
  8866. ]),
  8867. vue.createElementVNode("view", {
  8868. class: "vip-btn",
  8869. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.navToLevel && _ctx.navToLevel(...args))
  8870. }, [
  8871. vue.createElementVNode("text", null, "查看权益"),
  8872. vue.createElementVNode("image", {
  8873. class: "arrow-icon-small",
  8874. src: _imports_6
  8875. })
  8876. ])
  8877. ])
  8878. ]),
  8879. vue.createElementVNode("view", { class: "stats-panel" }, [
  8880. vue.createElementVNode("view", {
  8881. class: "stat-item",
  8882. onClick: _cache[3] || (_cache[3] = (...args) => _ctx.navToWallet && _ctx.navToWallet(...args))
  8883. }, [
  8884. vue.createElementVNode("view", { class: "stat-header" }, [
  8885. vue.createElementVNode("view", { class: "red-bar" }),
  8886. vue.createElementVNode("text", { class: "label" }, "我的钱包"),
  8887. vue.createElementVNode("image", {
  8888. class: "arrow-icon",
  8889. src: _imports_3
  8890. })
  8891. ]),
  8892. vue.createElementVNode("view", { class: "stat-value" }, [
  8893. vue.createElementVNode(
  8894. "text",
  8895. { class: "num" },
  8896. vue.toDisplayString(((_j = _ctx.profile) == null ? void 0 : _j.balance) ? (_ctx.profile.balance / 100).toFixed(2) : "0.00"),
  8897. 1
  8898. /* TEXT */
  8899. ),
  8900. vue.createElementVNode("text", { class: "unit" }, "元")
  8901. ]),
  8902. vue.createElementVNode("text", { class: "sub-text" }, "账户余额")
  8903. ]),
  8904. vue.createElementVNode("view", { class: "divider" }),
  8905. vue.createElementVNode("view", {
  8906. class: "stat-item",
  8907. onClick: _cache[4] || (_cache[4] = (...args) => _ctx.navToOrderStats && _ctx.navToOrderStats(...args))
  8908. }, [
  8909. vue.createElementVNode("view", { class: "stat-header" }, [
  8910. vue.createElementVNode("view", { class: "green-bar" }),
  8911. vue.createElementVNode("text", { class: "label" }, "订单统计"),
  8912. vue.createElementVNode("image", {
  8913. class: "arrow-icon",
  8914. src: _imports_3
  8915. })
  8916. ]),
  8917. vue.createElementVNode("view", { class: "stat-value" }, [
  8918. vue.createElementVNode(
  8919. "text",
  8920. { class: "num" },
  8921. vue.toDisplayString(((_k = _ctx.profile) == null ? void 0 : _k.orderCount) || 0),
  8922. 1
  8923. /* TEXT */
  8924. ),
  8925. vue.createElementVNode("text", { class: "unit" }, "单")
  8926. ]),
  8927. vue.createElementVNode("text", { class: "sub-text" }, "累计服务单量")
  8928. ]),
  8929. vue.createElementVNode("view", { class: "divider" }),
  8930. vue.createElementVNode("view", {
  8931. class: "stat-item",
  8932. onClick: _cache[5] || (_cache[5] = (...args) => _ctx.navToPoints && _ctx.navToPoints(...args))
  8933. }, [
  8934. vue.createElementVNode("view", { class: "stat-header" }, [
  8935. vue.createElementVNode("view", { class: "orange-bar" }),
  8936. vue.createElementVNode("text", { class: "label" }, "我的积分"),
  8937. vue.createElementVNode("image", {
  8938. class: "arrow-icon",
  8939. src: _imports_3
  8940. })
  8941. ]),
  8942. vue.createElementVNode("view", { class: "stat-value" }, [
  8943. vue.createElementVNode(
  8944. "text",
  8945. { class: "num" },
  8946. vue.toDisplayString(((_l = _ctx.profile) == null ? void 0 : _l.points) || 0),
  8947. 1
  8948. /* TEXT */
  8949. ),
  8950. vue.createElementVNode("text", { class: "unit" }, "分")
  8951. ]),
  8952. vue.createElementVNode("text", { class: "sub-text" }, "可兑换权益")
  8953. ])
  8954. ]),
  8955. vue.createElementVNode("view", { class: "menu-list" }, [
  8956. vue.createElementVNode("view", {
  8957. class: "menu-item",
  8958. onClick: _cache[6] || (_cache[6] = (...args) => _ctx.navToRewards && _ctx.navToRewards(...args))
  8959. }, [
  8960. vue.createElementVNode("image", {
  8961. class: "menu-icon",
  8962. src: _imports_8
  8963. }),
  8964. vue.createElementVNode("text", { class: "menu-text" }, "我的奖惩"),
  8965. vue.createElementVNode("image", {
  8966. class: "arrow-icon",
  8967. src: _imports_3
  8968. })
  8969. ]),
  8970. vue.createElementVNode("view", {
  8971. class: "menu-item",
  8972. onClick: _cache[7] || (_cache[7] = (...args) => _ctx.openServicePopup && _ctx.openServicePopup(...args))
  8973. }, [
  8974. vue.createElementVNode("image", {
  8975. class: "menu-icon",
  8976. src: _imports_9
  8977. }),
  8978. vue.createElementVNode("text", { class: "menu-text" }, "联系客服"),
  8979. vue.createElementVNode("image", {
  8980. class: "arrow-icon",
  8981. src: _imports_3
  8982. })
  8983. ])
  8984. ]),
  8985. vue.createElementVNode("view", {
  8986. class: "logout-btn",
  8987. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.logout && _ctx.logout(...args))
  8988. }, "退出登录"),
  8989. _ctx.showServicePopup ? (vue.openBlock(), vue.createElementBlock("view", {
  8990. key: 0,
  8991. class: "service-popup-mask",
  8992. onClick: _cache[15] || (_cache[15] = (...args) => _ctx.closeServicePopup && _ctx.closeServicePopup(...args))
  8993. }, [
  8994. vue.createElementVNode("view", {
  8995. class: "service-popup",
  8996. onClick: _cache[14] || (_cache[14] = vue.withModifiers(() => {
  8997. }, ["stop"]))
  8998. }, [
  8999. vue.createElementVNode("view", { class: "service-header" }, [
  9000. vue.createElementVNode("text", { class: "service-title" }, "联系客服"),
  9001. vue.createElementVNode("image", {
  9002. class: "close-icon",
  9003. src: _imports_10,
  9004. onClick: _cache[9] || (_cache[9] = (...args) => _ctx.closeServicePopup && _ctx.closeServicePopup(...args))
  9005. })
  9006. ]),
  9007. vue.createElementVNode("view", { class: "qr-section" }, [
  9008. vue.createElementVNode("text", { class: "qr-title" }, "客服二维码"),
  9009. vue.createElementVNode("image", {
  9010. class: "qr-img",
  9011. src: _ctx.customerSetting.qrCodeUrl || "/static/logo.png",
  9012. onClick: _cache[10] || (_cache[10] = (...args) => _ctx.previewQRCode && _ctx.previewQRCode(...args))
  9013. }, null, 8, ["src"]),
  9014. vue.createElementVNode("text", { class: "qr-desc" }, "点击查看大图")
  9015. ]),
  9016. vue.createElementVNode("view", { class: "service-list" }, [
  9017. vue.createElementVNode("view", {
  9018. class: "service-row",
  9019. onClick: _cache[12] || (_cache[12] = (...args) => _ctx.openOnlineService && _ctx.openOnlineService(...args))
  9020. }, [
  9021. vue.createElementVNode("image", {
  9022. class: "service-row-icon",
  9023. src: _imports_11
  9024. }),
  9025. vue.createElementVNode("view", { class: "service-info" }, [
  9026. vue.createElementVNode("text", { class: "service-name" }, "在线客服"),
  9027. vue.createElementVNode(
  9028. "text",
  9029. { class: "service-desc" },
  9030. vue.toDisplayString(_ctx.customerSetting.wechatAccount || "企业微信专属客服在线解答"),
  9031. 1
  9032. /* TEXT */
  9033. )
  9034. ]),
  9035. vue.createElementVNode("view", {
  9036. class: "call-btn",
  9037. onClick: _cache[11] || (_cache[11] = (...args) => _ctx.openOnlineService && _ctx.openOnlineService(...args))
  9038. }, [
  9039. vue.createElementVNode("image", {
  9040. class: "phone-icon-small",
  9041. src: _imports_11
  9042. }),
  9043. vue.createElementVNode("text", null, "企业微信")
  9044. ])
  9045. ]),
  9046. vue.createElementVNode("view", { class: "service-row" }, [
  9047. vue.createElementVNode("image", {
  9048. class: "service-row-icon",
  9049. src: _imports_12
  9050. }),
  9051. vue.createElementVNode("view", { class: "service-info" }, [
  9052. vue.createElementVNode("text", { class: "service-name" }, "客服电话"),
  9053. vue.createElementVNode(
  9054. "text",
  9055. { class: "service-desc" },
  9056. vue.toDisplayString(_ctx.customerSetting.phoneNumber || "暂无电话"),
  9057. 1
  9058. /* TEXT */
  9059. )
  9060. ]),
  9061. vue.createElementVNode("view", {
  9062. class: "call-btn",
  9063. onClick: _cache[13] || (_cache[13] = (...args) => _ctx.callServicePhone && _ctx.callServicePhone(...args))
  9064. }, [
  9065. vue.createElementVNode("image", {
  9066. class: "phone-icon-small",
  9067. src: _imports_13
  9068. }),
  9069. vue.createElementVNode("text", null, "拨打")
  9070. ])
  9071. ])
  9072. ])
  9073. ])
  9074. ])) : vue.createCommentVNode("v-if", true),
  9075. vue.createElementVNode(
  9076. "view",
  9077. {
  9078. class: vue.normalizeClass(["logout-popup-mask", { "show": _ctx.showLogoutPopup }]),
  9079. onClick: _cache[19] || (_cache[19] = (...args) => _ctx.cancelLogout && _ctx.cancelLogout(...args)),
  9080. onTouchmove: _cache[20] || (_cache[20] = vue.withModifiers(() => {
  9081. }, ["stop", "prevent"]))
  9082. },
  9083. [
  9084. vue.createElementVNode("view", {
  9085. class: "popup-modal",
  9086. onClick: _cache[18] || (_cache[18] = vue.withModifiers(() => {
  9087. }, ["stop"]))
  9088. }, [
  9089. vue.createElementVNode("text", { class: "popup-title" }, "退出登录"),
  9090. vue.createElementVNode("text", { class: "popup-desc" }, "确定要退出当前账号吗?\\n退出后需要重新登录才能使用完整功能。"),
  9091. vue.createElementVNode("view", { class: "popup-actions" }, [
  9092. vue.createElementVNode("view", {
  9093. class: "popup-btn cancel",
  9094. onClick: _cache[16] || (_cache[16] = (...args) => _ctx.cancelLogout && _ctx.cancelLogout(...args))
  9095. }, "取消"),
  9096. vue.createElementVNode("view", {
  9097. class: "popup-btn confirm",
  9098. onClick: _cache[17] || (_cache[17] = (...args) => _ctx.confirmLogout && _ctx.confirmLogout(...args))
  9099. }, "确定")
  9100. ])
  9101. ])
  9102. ],
  9103. 34
  9104. /* CLASS, NEED_HYDRATION */
  9105. )
  9106. ]),
  9107. vue.createVNode(_component_custom_tabbar, { currentPath: "pages/mine/index" })
  9108. ],
  9109. 64
  9110. /* STABLE_FRAGMENT */
  9111. );
  9112. }
  9113. const PagesMineIndex = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/index.vue"]]);
  9114. const _sfc_main$l = {
  9115. data() {
  9116. return {
  9117. version: "2.0.6",
  9118. cacheSize: "0B",
  9119. // 明确默认状态为开启:获取不到缓存即为 true,以此确保默认值为开启。
  9120. isGpsEnabled: uni.getStorageSync("GPS_REPORT_ENABLED") !== false
  9121. };
  9122. },
  9123. onLoad() {
  9124. this.getAppVersion();
  9125. this.getCacheSize();
  9126. },
  9127. methods: {
  9128. navBack() {
  9129. uni.navigateBack({
  9130. delta: 1
  9131. });
  9132. },
  9133. navTo(type) {
  9134. let url = "";
  9135. switch (type) {
  9136. case "profile":
  9137. url = "/pages/mine/settings/profile/index";
  9138. break;
  9139. case "auth":
  9140. url = "/pages/mine/settings/auth/index";
  9141. break;
  9142. case "bank":
  9143. url = "/pages/mine/settings/bank/index";
  9144. break;
  9145. case "security":
  9146. url = "/pages/mine/settings/security/index";
  9147. break;
  9148. case "push":
  9149. url = "/pages/mine/settings/notification/index";
  9150. break;
  9151. case "about":
  9152. url = "/pages/mine/settings/about/index";
  9153. break;
  9154. default:
  9155. formatAppLog("log", "at pages/mine/settings/index.vue:114", "Navigate to:", type);
  9156. return;
  9157. }
  9158. uni.navigateTo({ url });
  9159. },
  9160. clearCache() {
  9161. uni.showModal({
  9162. title: "清理缓存",
  9163. content: "确定要清理应用缓存吗?",
  9164. success: (res) => {
  9165. if (res.confirm) {
  9166. try {
  9167. const token = uni.getStorageSync("Authorization_token");
  9168. const gpsToggle = uni.getStorageSync("GPS_REPORT_ENABLED");
  9169. uni.clearStorageSync();
  9170. if (token)
  9171. uni.setStorageSync("Authorization_token", token);
  9172. uni.setStorageSync("GPS_REPORT_ENABLED", gpsToggle);
  9173. uni.showToast({ title: "清理完成", icon: "success" });
  9174. this.getCacheSize();
  9175. } catch (err) {
  9176. formatAppLog("error", "at pages/mine/settings/index.vue:140", "清理缓存失败:", err);
  9177. }
  9178. }
  9179. }
  9180. });
  9181. },
  9182. getCacheSize() {
  9183. try {
  9184. const res = uni.getStorageInfoSync();
  9185. const kb = res.currentSize;
  9186. if (kb < 1024) {
  9187. this.cacheSize = kb + "KB";
  9188. } else {
  9189. this.cacheSize = (kb / 1024).toFixed(2) + "MB";
  9190. }
  9191. } catch (err) {
  9192. this.cacheSize = "0B";
  9193. }
  9194. },
  9195. getAppVersion() {
  9196. plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
  9197. this.version = widgetInfo.version || "2.0.6";
  9198. });
  9199. },
  9200. onGpsSwitchChange(e) {
  9201. const val = e.detail.value;
  9202. this.isGpsEnabled = val;
  9203. uni.setStorageSync("GPS_REPORT_ENABLED", val);
  9204. if (val) {
  9205. startGpsTimer();
  9206. } else {
  9207. stopGpsTimer();
  9208. }
  9209. }
  9210. }
  9211. };
  9212. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  9213. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  9214. vue.createElementVNode("view", { class: "custom-header" }, [
  9215. vue.createElementVNode("view", {
  9216. class: "header-left",
  9217. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  9218. }, [
  9219. vue.createElementVNode("image", {
  9220. class: "back-icon",
  9221. src: _imports_0,
  9222. style: { "transform": "rotate(180deg)" }
  9223. })
  9224. ]),
  9225. vue.createElementVNode("text", { class: "header-title" }, "设置"),
  9226. vue.createElementVNode("view", { class: "header-right" })
  9227. ]),
  9228. vue.createElementVNode("view", { class: "header-placeholder" }),
  9229. vue.createElementVNode("view", { class: "group-card" }, [
  9230. vue.createElementVNode("view", {
  9231. class: "list-item",
  9232. onClick: _cache[1] || (_cache[1] = ($event) => $options.navTo("profile"))
  9233. }, [
  9234. vue.createElementVNode("text", { class: "item-title" }, "个人资料"),
  9235. vue.createElementVNode("image", {
  9236. class: "arrow-icon",
  9237. src: _imports_3
  9238. })
  9239. ]),
  9240. vue.createElementVNode("view", {
  9241. class: "list-item",
  9242. onClick: _cache[2] || (_cache[2] = ($event) => $options.navTo("auth"))
  9243. }, [
  9244. vue.createElementVNode("text", { class: "item-title" }, "认证信息"),
  9245. vue.createElementVNode("image", {
  9246. class: "arrow-icon",
  9247. src: _imports_3
  9248. })
  9249. ]),
  9250. vue.createElementVNode("view", {
  9251. class: "list-item no-border",
  9252. onClick: _cache[3] || (_cache[3] = ($event) => $options.navTo("security"))
  9253. }, [
  9254. vue.createElementVNode("text", { class: "item-title" }, "账号与安全"),
  9255. vue.createElementVNode("image", {
  9256. class: "arrow-icon",
  9257. src: _imports_3
  9258. })
  9259. ])
  9260. ]),
  9261. vue.createElementVNode("view", { class: "group-card" }, [
  9262. vue.createElementVNode("view", { class: "list-item" }, [
  9263. vue.createElementVNode("view", { class: "item-row-left" }, [
  9264. vue.createElementVNode("text", { class: "item-title" }, "位置上报"),
  9265. vue.createElementVNode("text", { class: "item-subtitle" }, "每隔20分钟自动上报位置")
  9266. ]),
  9267. vue.createElementVNode("switch", {
  9268. checked: $data.isGpsEnabled,
  9269. color: "#FF5722",
  9270. style: { "transform": "scale(0.8)" },
  9271. onChange: _cache[4] || (_cache[4] = (...args) => $options.onGpsSwitchChange && $options.onGpsSwitchChange(...args))
  9272. }, null, 40, ["checked"])
  9273. ]),
  9274. vue.createElementVNode("view", {
  9275. class: "list-item",
  9276. onClick: _cache[5] || (_cache[5] = (...args) => $options.clearCache && $options.clearCache(...args))
  9277. }, [
  9278. vue.createElementVNode("text", { class: "item-title" }, "清理缓存"),
  9279. vue.createElementVNode("view", { class: "item-right" }, [
  9280. vue.createElementVNode(
  9281. "text",
  9282. { class: "item-value" },
  9283. vue.toDisplayString($data.cacheSize),
  9284. 1
  9285. /* TEXT */
  9286. ),
  9287. vue.createElementVNode("image", {
  9288. class: "arrow-icon",
  9289. src: _imports_3
  9290. })
  9291. ])
  9292. ]),
  9293. vue.createElementVNode("view", {
  9294. class: "list-item no-border",
  9295. onClick: _cache[6] || (_cache[6] = ($event) => $options.navTo("about"))
  9296. }, [
  9297. vue.createElementVNode("text", { class: "item-title" }, "关于我们"),
  9298. vue.createElementVNode("view", { class: "item-right" }, [
  9299. vue.createElementVNode(
  9300. "text",
  9301. { class: "item-value" },
  9302. "v" + vue.toDisplayString($data.version),
  9303. 1
  9304. /* TEXT */
  9305. ),
  9306. vue.createElementVNode("image", {
  9307. class: "arrow-icon",
  9308. src: _imports_3
  9309. })
  9310. ])
  9311. ])
  9312. ])
  9313. ]);
  9314. }
  9315. const PagesMineSettingsIndex = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/index.vue"]]);
  9316. const _sfc_main$k = {
  9317. data() {
  9318. return {
  9319. userInfo: {
  9320. name: "",
  9321. workType: "",
  9322. workStatus: "",
  9323. city: "",
  9324. avatar: "/static/touxiang.png",
  9325. stationName: "",
  9326. stationFullName: ""
  9327. },
  9328. isStatusPickerShow: false,
  9329. isCityPickerShow: false,
  9330. // 城市站点级联选择器
  9331. selectStep: 0,
  9332. selectedPathway: [],
  9333. currentCityList: [],
  9334. selectedCityId: null,
  9335. fullTree: []
  9336. // 树形结构数据
  9337. };
  9338. },
  9339. onLoad() {
  9340. this.loadUserInfo();
  9341. uni.$on("updateName", (newName) => {
  9342. this.userInfo.name = newName;
  9343. });
  9344. },
  9345. onUnload() {
  9346. uni.$off("updateName");
  9347. },
  9348. methods: {
  9349. // 加载用户信息 @author steelwei
  9350. async loadUserInfo() {
  9351. uni.showLoading({ title: "加载中..." });
  9352. try {
  9353. const res = await getMyProfile();
  9354. if (res.code === 200) {
  9355. const data = res.data;
  9356. this.userInfo = {
  9357. name: data.realName || data.name,
  9358. workType: data.workType === "full_time" ? "全职" : "兼职",
  9359. workStatus: this.formatStatus(data.status),
  9360. city: data.cityName || "",
  9361. avatar: data.avatarUrl || "/static/touxiang.png",
  9362. stationName: data.stationName || "",
  9363. stationFullName: "加载中..."
  9364. };
  9365. if (data.stationId) {
  9366. if (this.fullTree.length === 0) {
  9367. await this.loadAreaStationTree();
  9368. }
  9369. this.userInfo.stationFullName = this.findStationFullName(data.stationId, this.fullTree) || data.stationName || "未分配站点";
  9370. } else {
  9371. this.userInfo.stationFullName = "未分配站点";
  9372. }
  9373. } else {
  9374. uni.showToast({ title: res.msg || "加载失败", icon: "none" });
  9375. }
  9376. } catch (error) {
  9377. formatAppLog("error", "at pages/mine/settings/profile/index.vue:182", "加载用户信息失败:", error);
  9378. uni.showToast({ title: "网络错误", icon: "none" });
  9379. } finally {
  9380. uni.hideLoading();
  9381. }
  9382. },
  9383. // 格式化状态 @author steelwei
  9384. formatStatus(status) {
  9385. const statusMap = {
  9386. "busy": "接单中",
  9387. "resting": "休息中",
  9388. "disabled": "已禁用"
  9389. };
  9390. return statusMap[status] || status;
  9391. },
  9392. // 查找站点完整路径 (城市/区域/站点) @author steelwei
  9393. findStationFullName(stationId, tree) {
  9394. if (!stationId || !tree || tree.length === 0)
  9395. return "";
  9396. let path = [];
  9397. const dfs = (nodes, targetId, currentPath) => {
  9398. for (let node of nodes) {
  9399. if (node.id === targetId) {
  9400. path = [...currentPath, node.name];
  9401. return true;
  9402. }
  9403. if (node.children && node.children.length > 0) {
  9404. if (dfs(node.children, targetId, [...currentPath, node.name])) {
  9405. return true;
  9406. }
  9407. }
  9408. }
  9409. return false;
  9410. };
  9411. dfs(tree, stationId, []);
  9412. return path.join("/");
  9413. },
  9414. navBack() {
  9415. uni.navigateBack({ delta: 1 });
  9416. },
  9417. // 修改头像 @author steelwei
  9418. changeAvatar() {
  9419. uni.chooseImage({
  9420. count: 1,
  9421. success: async (res) => {
  9422. const tempFilePath = res.tempFilePaths[0];
  9423. uni.showLoading({ title: "上传中..." });
  9424. try {
  9425. const uploadRes = await uploadFile(tempFilePath);
  9426. if (uploadRes.code === 200) {
  9427. const { url, ossId } = uploadRes.data;
  9428. const result = await updateAvatar(ossId);
  9429. if (result.code === 200) {
  9430. this.userInfo.avatar = url;
  9431. uni.showToast({ title: "修改成功", icon: "success" });
  9432. } else {
  9433. uni.showToast({ title: result.msg || "修改失败", icon: "none" });
  9434. }
  9435. }
  9436. } catch (error) {
  9437. formatAppLog("error", "at pages/mine/settings/profile/index.vue:251", "修改头像失败:", error);
  9438. uni.showToast({ title: "上传失败", icon: "none" });
  9439. } finally {
  9440. uni.hideLoading();
  9441. }
  9442. }
  9443. });
  9444. },
  9445. editName() {
  9446. uni.navigateTo({
  9447. url: `/pages/mine/settings/profile/edit-name?name=${this.userInfo.name}`
  9448. });
  9449. },
  9450. showStatusPicker() {
  9451. this.isStatusPickerShow = true;
  9452. },
  9453. closeStatusPicker() {
  9454. this.isStatusPickerShow = false;
  9455. },
  9456. // 选择状态 @author steelwei
  9457. async selectStatus(statusText) {
  9458. const statusMap = {
  9459. "接单中": "busy",
  9460. "休息中": "resting"
  9461. };
  9462. const status = statusMap[statusText];
  9463. try {
  9464. const res = await updateStatus(status);
  9465. if (res.code === 200) {
  9466. this.userInfo.workStatus = statusText;
  9467. uni.showToast({ title: "状态已更新", icon: "success" });
  9468. } else {
  9469. uni.showToast({ title: res.msg || "修改失败", icon: "none" });
  9470. }
  9471. } catch (error) {
  9472. formatAppLog("error", "at pages/mine/settings/profile/index.vue:291", "修改状态失败:", error);
  9473. uni.showToast({ title: "网络错误", icon: "none" });
  9474. } finally {
  9475. this.closeStatusPicker();
  9476. }
  9477. },
  9478. // 城市和站点级联选择器 @author steelwei
  9479. async showCityPicker() {
  9480. this.isCityPickerShow = true;
  9481. if (this.fullTree.length === 0) {
  9482. await this.loadAreaStationTree();
  9483. }
  9484. if (this.selectedPathway.length === 0) {
  9485. this.resetCityPicker();
  9486. }
  9487. },
  9488. async loadAreaStationTree() {
  9489. try {
  9490. uni.showLoading({ title: "加载中..." });
  9491. const res = await getAreaStationList();
  9492. const list = res.data || [];
  9493. let map = {};
  9494. let roots = [];
  9495. list.forEach((node) => {
  9496. map[node.id] = { ...node, children: [] };
  9497. });
  9498. list.forEach((node) => {
  9499. if (node.parentId === 0 || !map[node.parentId]) {
  9500. roots.push(map[node.id]);
  9501. } else {
  9502. map[node.parentId].children.push(map[node.id]);
  9503. }
  9504. });
  9505. this.fullTree = roots;
  9506. } catch (err) {
  9507. formatAppLog("error", "at pages/mine/settings/profile/index.vue:328", "加载站点数据失败:", err);
  9508. this.fullTree = [];
  9509. } finally {
  9510. uni.hideLoading();
  9511. }
  9512. },
  9513. resetCityPicker() {
  9514. this.selectStep = 0;
  9515. this.selectedPathway = [];
  9516. this.currentCityList = this.fullTree;
  9517. },
  9518. closeCityPicker() {
  9519. this.isCityPickerShow = false;
  9520. },
  9521. selectCityItem(item) {
  9522. this.selectedPathway[this.selectStep] = item;
  9523. if (item.children && item.children.length > 0) {
  9524. this.selectStep++;
  9525. this.selectedPathway = this.selectedPathway.slice(0, this.selectStep);
  9526. this.currentCityList = item.children;
  9527. } else {
  9528. this.selectedCityId = item.id;
  9529. this.confirmCity();
  9530. }
  9531. },
  9532. jumpToStep(step) {
  9533. this.selectStep = step;
  9534. if (step === 0) {
  9535. this.currentCityList = this.fullTree;
  9536. } else {
  9537. const parent = this.selectedPathway[step - 1];
  9538. this.currentCityList = parent ? parent.children : [];
  9539. }
  9540. },
  9541. // 确认城市与站点选择 @author steelwei
  9542. async confirmCity() {
  9543. if (this.selectedPathway.length === 0) {
  9544. uni.showToast({ title: "请选择站点", icon: "none" });
  9545. return;
  9546. }
  9547. let stationNode = this.selectedPathway[this.selectedPathway.length - 1];
  9548. const fullName = this.selectedPathway.map((i) => i.name).join("/");
  9549. const reqData = {
  9550. stationId: stationNode.id
  9551. };
  9552. try {
  9553. const res = await updateCity(reqData);
  9554. if (res.code === 200) {
  9555. this.userInfo.stationFullName = fullName;
  9556. uni.showToast({ title: "修改成功", icon: "success" });
  9557. this.closeCityPicker();
  9558. this.selectedPathway = [];
  9559. } else {
  9560. uni.showToast({ title: res.msg || "修改失败", icon: "none" });
  9561. }
  9562. } catch (error) {
  9563. formatAppLog("error", "at pages/mine/settings/profile/index.vue:393", "修改失败:", error);
  9564. uni.showToast({ title: "网络错误", icon: "none" });
  9565. }
  9566. }
  9567. }
  9568. };
  9569. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  9570. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  9571. vue.createElementVNode("view", { class: "custom-header" }, [
  9572. vue.createElementVNode("view", {
  9573. class: "header-left",
  9574. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  9575. }, [
  9576. vue.createElementVNode("image", {
  9577. class: "back-icon",
  9578. src: _imports_0,
  9579. style: { "transform": "rotate(180deg)" }
  9580. })
  9581. ]),
  9582. vue.createElementVNode("text", { class: "header-title" }, "个人资料"),
  9583. vue.createElementVNode("view", { class: "header-right" })
  9584. ]),
  9585. vue.createElementVNode("view", { class: "header-placeholder" }),
  9586. vue.createElementVNode("view", { class: "group-card" }, [
  9587. vue.createElementVNode("view", {
  9588. class: "list-item",
  9589. onClick: _cache[1] || (_cache[1] = (...args) => $options.changeAvatar && $options.changeAvatar(...args))
  9590. }, [
  9591. vue.createElementVNode("text", { class: "item-title" }, "头像"),
  9592. vue.createElementVNode("view", { class: "item-right" }, [
  9593. vue.createElementVNode("image", {
  9594. class: "user-avatar",
  9595. src: $data.userInfo.avatar,
  9596. mode: "aspectFill"
  9597. }, null, 8, ["src"]),
  9598. vue.createElementVNode("image", {
  9599. class: "arrow-icon",
  9600. src: _imports_3
  9601. })
  9602. ])
  9603. ]),
  9604. vue.createElementVNode("view", {
  9605. class: "list-item",
  9606. onClick: _cache[2] || (_cache[2] = (...args) => $options.editName && $options.editName(...args))
  9607. }, [
  9608. vue.createElementVNode("text", { class: "item-title" }, "真实姓名"),
  9609. vue.createElementVNode("view", { class: "item-right" }, [
  9610. vue.createElementVNode(
  9611. "text",
  9612. { class: "item-value" },
  9613. vue.toDisplayString($data.userInfo.name),
  9614. 1
  9615. /* TEXT */
  9616. ),
  9617. vue.createElementVNode("image", {
  9618. class: "arrow-icon",
  9619. src: _imports_3
  9620. })
  9621. ])
  9622. ])
  9623. ]),
  9624. vue.createElementVNode("view", { class: "group-card" }, [
  9625. vue.createElementVNode("view", {
  9626. class: "list-item",
  9627. onClick: _cache[3] || (_cache[3] = (...args) => $options.showStatusPicker && $options.showStatusPicker(...args))
  9628. }, [
  9629. vue.createElementVNode("text", { class: "item-title" }, "工作状态"),
  9630. vue.createElementVNode("view", { class: "item-right" }, [
  9631. vue.createElementVNode(
  9632. "text",
  9633. { class: "item-value-black" },
  9634. vue.toDisplayString($data.userInfo.workStatus),
  9635. 1
  9636. /* TEXT */
  9637. ),
  9638. vue.createElementVNode("image", {
  9639. class: "arrow-icon",
  9640. src: _imports_3
  9641. })
  9642. ])
  9643. ])
  9644. ]),
  9645. vue.createElementVNode("view", { class: "group-card" }, [
  9646. vue.createElementVNode("view", {
  9647. class: "list-item no-border",
  9648. onClick: _cache[4] || (_cache[4] = (...args) => $options.showCityPicker && $options.showCityPicker(...args))
  9649. }, [
  9650. vue.createElementVNode("text", { class: "item-title" }, "所属站点"),
  9651. vue.createElementVNode("view", { class: "item-right" }, [
  9652. vue.createElementVNode(
  9653. "text",
  9654. { class: "item-value" },
  9655. vue.toDisplayString($data.userInfo.stationFullName || "未分配站点"),
  9656. 1
  9657. /* TEXT */
  9658. ),
  9659. vue.createElementVNode("image", {
  9660. class: "arrow-icon",
  9661. src: _imports_3
  9662. })
  9663. ])
  9664. ])
  9665. ]),
  9666. $data.isStatusPickerShow ? (vue.openBlock(), vue.createElementBlock("view", {
  9667. key: 0,
  9668. class: "popup-mask",
  9669. onClick: _cache[9] || (_cache[9] = (...args) => $options.closeStatusPicker && $options.closeStatusPicker(...args))
  9670. }, [
  9671. vue.createElementVNode("view", {
  9672. class: "popup-content",
  9673. onClick: _cache[8] || (_cache[8] = vue.withModifiers(() => {
  9674. }, ["stop"]))
  9675. }, [
  9676. vue.createElementVNode("view", { class: "popup-title" }, "选择工作状态"),
  9677. vue.createElementVNode("view", {
  9678. class: "popup-item",
  9679. onClick: _cache[5] || (_cache[5] = ($event) => $options.selectStatus("接单中"))
  9680. }, "接单中"),
  9681. vue.createElementVNode("view", {
  9682. class: "popup-item",
  9683. onClick: _cache[6] || (_cache[6] = ($event) => $options.selectStatus("休息中"))
  9684. }, "休息中"),
  9685. vue.createElementVNode("view", {
  9686. class: "popup-cancel",
  9687. onClick: _cache[7] || (_cache[7] = (...args) => $options.closeStatusPicker && $options.closeStatusPicker(...args))
  9688. }, "取消")
  9689. ])
  9690. ])) : vue.createCommentVNode("v-if", true),
  9691. $data.isCityPickerShow ? (vue.openBlock(), vue.createElementBlock("view", {
  9692. key: 1,
  9693. class: "popup-mask",
  9694. onClick: _cache[13] || (_cache[13] = (...args) => $options.closeCityPicker && $options.closeCityPicker(...args))
  9695. }, [
  9696. vue.createElementVNode("view", {
  9697. class: "popup-content",
  9698. onClick: _cache[12] || (_cache[12] = vue.withModifiers(() => {
  9699. }, ["stop"]))
  9700. }, [
  9701. vue.createElementVNode("view", { class: "popup-header-row" }, [
  9702. vue.createElementVNode("text", {
  9703. class: "popup-btn-cancel",
  9704. onClick: _cache[10] || (_cache[10] = (...args) => $options.closeCityPicker && $options.closeCityPicker(...args))
  9705. }, "取消"),
  9706. vue.createElementVNode("text", { class: "popup-title-text" }, "请选择工作城市和站点"),
  9707. vue.createElementVNode("text", {
  9708. class: "popup-btn-confirm",
  9709. onClick: _cache[11] || (_cache[11] = (...args) => $options.confirmCity && $options.confirmCity(...args))
  9710. }, "确定")
  9711. ]),
  9712. vue.createElementVNode("view", { class: "picker-body" }, [
  9713. vue.createElementVNode("view", { class: "timeline-area" }, [
  9714. (vue.openBlock(true), vue.createElementBlock(
  9715. vue.Fragment,
  9716. null,
  9717. vue.renderList($data.selectedPathway, (item, index) => {
  9718. return vue.openBlock(), vue.createElementBlock("view", {
  9719. class: "timeline-item",
  9720. key: index,
  9721. onClick: ($event) => $options.jumpToStep(index)
  9722. }, [
  9723. vue.createElementVNode("view", { class: "timeline-dot" }),
  9724. vue.createElementVNode(
  9725. "text",
  9726. null,
  9727. vue.toDisplayString(item.name),
  9728. 1
  9729. /* TEXT */
  9730. )
  9731. ], 8, ["onClick"]);
  9732. }),
  9733. 128
  9734. /* KEYED_FRAGMENT */
  9735. )),
  9736. $data.selectStep === $data.selectedPathway.length ? (vue.openBlock(), vue.createElementBlock("view", {
  9737. key: 0,
  9738. class: "timeline-item active"
  9739. }, [
  9740. vue.createElementVNode("view", { class: "timeline-dot" }),
  9741. vue.createElementVNode("text", null, "请选择")
  9742. ])) : vue.createCommentVNode("v-if", true)
  9743. ]),
  9744. vue.createElementVNode("scroll-view", {
  9745. "scroll-y": "",
  9746. class: "list-area"
  9747. }, [
  9748. (vue.openBlock(true), vue.createElementBlock(
  9749. vue.Fragment,
  9750. null,
  9751. vue.renderList($data.currentCityList, (item) => {
  9752. return vue.openBlock(), vue.createElementBlock("view", {
  9753. class: "list-item",
  9754. key: item.id,
  9755. onClick: ($event) => $options.selectCityItem(item)
  9756. }, vue.toDisplayString(item.name), 9, ["onClick"]);
  9757. }),
  9758. 128
  9759. /* KEYED_FRAGMENT */
  9760. )),
  9761. $data.currentCityList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  9762. key: 0,
  9763. style: { "padding": "20rpx", "color": "#999" }
  9764. }, " 无数据 ")) : vue.createCommentVNode("v-if", true)
  9765. ])
  9766. ])
  9767. ])
  9768. ])) : vue.createCommentVNode("v-if", true)
  9769. ]);
  9770. }
  9771. const PagesMineSettingsProfileIndex = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/profile/index.vue"]]);
  9772. const _sfc_main$j = {
  9773. data() {
  9774. return {
  9775. authInfo: {
  9776. realName: "",
  9777. idCard: "",
  9778. idCardFront: "",
  9779. idCardBack: "",
  9780. serviceTypes: [],
  9781. authId: false,
  9782. authQual: false,
  9783. pendingAudit: false,
  9784. qualImages: []
  9785. }
  9786. };
  9787. },
  9788. onLoad() {
  9789. this.loadAuthInfo();
  9790. },
  9791. methods: {
  9792. navBack() {
  9793. uni.navigateBack({
  9794. delta: 1
  9795. });
  9796. },
  9797. async loadAuthInfo() {
  9798. try {
  9799. const res = await getAuthInfo();
  9800. if (res.code === 200 && res.data) {
  9801. this.authInfo = {
  9802. realName: res.data.realName || "",
  9803. idCard: res.data.idCard || "",
  9804. idCardFront: res.data.idCardFrontUrl || "",
  9805. idCardBack: res.data.idCardBackUrl || "",
  9806. serviceTypes: res.data.serviceTypeList || [],
  9807. authId: res.data.authId || false,
  9808. authQual: res.data.authQual || false,
  9809. pendingAudit: res.data.pendingAudit || false,
  9810. qualImages: res.data.qualImageUrls ? res.data.qualImageUrls.split(",").filter(Boolean) : []
  9811. };
  9812. }
  9813. } catch (e) {
  9814. formatAppLog("error", "at pages/mine/settings/auth/index.vue:133", "加载认证信息失败", e);
  9815. uni.showToast({ title: "加载失败", icon: "none" });
  9816. }
  9817. },
  9818. maskIdCard(idCard) {
  9819. if (!idCard || idCard.length < 8)
  9820. return idCard;
  9821. return idCard.substring(0, 4) + "**********" + idCard.substring(idCard.length - 4);
  9822. },
  9823. editAuth() {
  9824. uni.showModal({
  9825. title: "提示",
  9826. content: "修改认证信息需要重新审核,审核期间无法接单,确定要继续吗?",
  9827. success: (res) => {
  9828. if (res.confirm) {
  9829. uni.navigateTo({
  9830. url: "/pages/mine/settings/auth/edit"
  9831. });
  9832. }
  9833. }
  9834. });
  9835. }
  9836. }
  9837. };
  9838. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  9839. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  9840. vue.createElementVNode("view", { class: "custom-header" }, [
  9841. vue.createElementVNode("view", {
  9842. class: "header-left",
  9843. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  9844. }, [
  9845. vue.createElementVNode("image", {
  9846. class: "back-icon",
  9847. src: _imports_0,
  9848. style: { "transform": "rotate(180deg)" }
  9849. })
  9850. ]),
  9851. vue.createElementVNode("text", { class: "header-title" }, "认证信息"),
  9852. vue.createElementVNode("view", { class: "header-right" })
  9853. ]),
  9854. vue.createElementVNode("view", { class: "header-placeholder" }),
  9855. vue.createElementVNode("view", { class: "card" }, [
  9856. vue.createElementVNode("view", { class: "section-header" }, [
  9857. vue.createElementVNode("view", { class: "orange-bar" }),
  9858. vue.createElementVNode("text", { class: "section-title" }, "身份认证"),
  9859. $data.authInfo.pendingAudit ? (vue.openBlock(), vue.createElementBlock("view", {
  9860. key: 0,
  9861. class: "tag-orange"
  9862. }, "认证中")) : $data.authInfo.authId ? (vue.openBlock(), vue.createElementBlock("view", {
  9863. key: 1,
  9864. class: "tag-green"
  9865. }, "已认证")) : (vue.openBlock(), vue.createElementBlock("view", {
  9866. key: 2,
  9867. class: "tag-gray"
  9868. }, "未认证"))
  9869. ]),
  9870. vue.createElementVNode("view", { class: "info-row" }, [
  9871. vue.createElementVNode("text", { class: "label" }, "真实姓名"),
  9872. vue.createElementVNode(
  9873. "text",
  9874. { class: "value" },
  9875. vue.toDisplayString($data.authInfo.realName || "未设置"),
  9876. 1
  9877. /* TEXT */
  9878. )
  9879. ]),
  9880. vue.createElementVNode("view", { class: "info-row" }, [
  9881. vue.createElementVNode("text", { class: "label" }, "证件号码"),
  9882. vue.createElementVNode(
  9883. "text",
  9884. { class: "value" },
  9885. vue.toDisplayString($options.maskIdCard($data.authInfo.idCard) || "未设置"),
  9886. 1
  9887. /* TEXT */
  9888. )
  9889. ]),
  9890. vue.createElementVNode("view", { class: "id-card-row" }, [
  9891. $data.authInfo.idCardFront ? (vue.openBlock(), vue.createElementBlock("view", {
  9892. key: 0,
  9893. class: "id-card-box green-bg"
  9894. }, [
  9895. vue.createElementVNode("image", {
  9896. class: "id-card-img",
  9897. src: $data.authInfo.idCardFront,
  9898. mode: "aspectFill"
  9899. }, null, 8, ["src"]),
  9900. vue.createElementVNode("view", { class: "corner-tag" }, "人像面")
  9901. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  9902. key: 1,
  9903. class: "id-card-box green-bg"
  9904. }, [
  9905. vue.createElementVNode("text", { class: "id-text" }, "ID Front"),
  9906. vue.createElementVNode("view", { class: "corner-tag" }, "人像面")
  9907. ])),
  9908. $data.authInfo.idCardBack ? (vue.openBlock(), vue.createElementBlock("view", {
  9909. key: 2,
  9910. class: "id-card-box green-bg"
  9911. }, [
  9912. vue.createElementVNode("image", {
  9913. class: "id-card-img",
  9914. src: $data.authInfo.idCardBack,
  9915. mode: "aspectFill"
  9916. }, null, 8, ["src"]),
  9917. vue.createElementVNode("view", { class: "corner-tag" }, "国徽面")
  9918. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  9919. key: 3,
  9920. class: "id-card-box green-bg"
  9921. }, [
  9922. vue.createElementVNode("text", { class: "id-text" }, "ID Back"),
  9923. vue.createElementVNode("view", { class: "corner-tag" }, "国徽面")
  9924. ]))
  9925. ])
  9926. ]),
  9927. vue.createElementVNode("view", { class: "card" }, [
  9928. vue.createElementVNode("view", { class: "section-header" }, [
  9929. vue.createElementVNode("view", { class: "orange-bar" }),
  9930. vue.createElementVNode("text", { class: "section-title" }, "服务类型")
  9931. ]),
  9932. vue.createElementVNode("view", { class: "tags-row" }, [
  9933. (vue.openBlock(true), vue.createElementBlock(
  9934. vue.Fragment,
  9935. null,
  9936. vue.renderList($data.authInfo.serviceTypes, (type, index) => {
  9937. return vue.openBlock(), vue.createElementBlock(
  9938. "view",
  9939. {
  9940. class: "service-tag",
  9941. key: index
  9942. },
  9943. vue.toDisplayString(type),
  9944. 1
  9945. /* TEXT */
  9946. );
  9947. }),
  9948. 128
  9949. /* KEYED_FRAGMENT */
  9950. )),
  9951. $data.authInfo.serviceTypes.length === 0 ? (vue.openBlock(), vue.createElementBlock("text", {
  9952. key: 0,
  9953. class: "empty-text"
  9954. }, "暂无服务类型")) : vue.createCommentVNode("v-if", true)
  9955. ])
  9956. ]),
  9957. vue.createElementVNode("view", { class: "card" }, [
  9958. vue.createElementVNode("view", { class: "section-header" }, [
  9959. vue.createElementVNode("view", { class: "orange-bar" }),
  9960. vue.createElementVNode("text", { class: "section-title" }, "资质证书")
  9961. ]),
  9962. vue.createElementVNode(
  9963. "text",
  9964. { class: "sub-title" },
  9965. vue.toDisplayString($data.authInfo.authQual ? "已认证" : "未认证"),
  9966. 1
  9967. /* TEXT */
  9968. ),
  9969. vue.createElementVNode("view", { class: "cert-row" }, [
  9970. (vue.openBlock(true), vue.createElementBlock(
  9971. vue.Fragment,
  9972. null,
  9973. vue.renderList($data.authInfo.qualImages, (img, index) => {
  9974. return vue.openBlock(), vue.createElementBlock("view", {
  9975. class: "cert-box yellow-bg",
  9976. key: index
  9977. }, [
  9978. vue.createElementVNode("image", {
  9979. class: "cert-img",
  9980. src: img,
  9981. mode: "aspectFill"
  9982. }, null, 8, ["src"])
  9983. ]);
  9984. }),
  9985. 128
  9986. /* KEYED_FRAGMENT */
  9987. )),
  9988. $data.authInfo.qualImages.length === 0 ? (vue.openBlock(), vue.createElementBlock("text", {
  9989. key: 0,
  9990. class: "empty-text"
  9991. }, "暂无资质证书")) : vue.createCommentVNode("v-if", true)
  9992. ])
  9993. ]),
  9994. vue.createElementVNode("view", { class: "bottom-btn-area" }, [
  9995. $data.authInfo.pendingAudit ? (vue.openBlock(), vue.createElementBlock("button", {
  9996. key: 0,
  9997. class: "action-btn disabled",
  9998. disabled: ""
  9999. }, "认证审核中...")) : (vue.openBlock(), vue.createElementBlock("button", {
  10000. key: 1,
  10001. class: "action-btn",
  10002. onClick: _cache[1] || (_cache[1] = (...args) => $options.editAuth && $options.editAuth(...args))
  10003. }, "修改认证信息")),
  10004. $data.authInfo.pendingAudit ? (vue.openBlock(), vue.createElementBlock("text", {
  10005. key: 2,
  10006. class: "tips"
  10007. }, "认证信息正在审核中,请耐心等待")) : (vue.openBlock(), vue.createElementBlock("text", {
  10008. key: 3,
  10009. class: "tips"
  10010. }, "修改认证信息需要重新审核,审核期间无法接单"))
  10011. ])
  10012. ]);
  10013. }
  10014. const PagesMineSettingsAuthIndex = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/auth/index.vue"]]);
  10015. const _sfc_main$i = {
  10016. data() {
  10017. return {
  10018. idCardFront: "",
  10019. idCardBack: "",
  10020. idCardFrontOssId: "",
  10021. idCardBackOssId: "",
  10022. serviceOptions: [],
  10023. selectedServices: [],
  10024. qualifications: {},
  10025. qualOssIds: {}
  10026. };
  10027. },
  10028. async onLoad() {
  10029. await this.loadServiceOptions();
  10030. this.loadAuthInfo();
  10031. },
  10032. methods: {
  10033. async loadServiceOptions() {
  10034. try {
  10035. const res = await getServiceTypes();
  10036. this.serviceOptions = (res.data || []).map((item) => ({
  10037. id: String(item.id),
  10038. name: item.name
  10039. }));
  10040. } catch (e) {
  10041. formatAppLog("error", "at pages/mine/settings/auth/edit.vue:135", "加载服务类型失败", e);
  10042. }
  10043. },
  10044. async loadAuthInfo() {
  10045. try {
  10046. uni.showLoading({ title: "加载中..." });
  10047. const res = await getAuthInfo();
  10048. if (res.code === 200 && res.data) {
  10049. this.idCardFront = res.data.idCardFrontUrl || "";
  10050. this.idCardBack = res.data.idCardBackUrl || "";
  10051. this.idCardFrontOssId = res.data.idCardFront || "";
  10052. this.idCardBackOssId = res.data.idCardBack || "";
  10053. let serviceIds = [];
  10054. if (res.data.serviceTypes) {
  10055. serviceIds = [...new Set(
  10056. String(res.data.serviceTypes).replace(/[\[\]"']/g, "").split(",").map((s) => s.trim()).filter((id) => id && id !== "0" && id !== "null" && id !== "undefined")
  10057. )];
  10058. }
  10059. this.selectedServices = serviceIds;
  10060. const qualUrlList = res.data.qualImageUrls ? res.data.qualImageUrls.split(",").filter(Boolean) : [];
  10061. const qualOssIdList = res.data.qualImages ? res.data.qualImages.replace(/[\[\]"]/g, "").split(",").map((s) => s.trim()).filter(Boolean) : [];
  10062. const validNames = serviceIds.map((sid) => this.getServiceName(sid)).filter(Boolean);
  10063. validNames.forEach((name, idx) => {
  10064. const start = Math.floor(idx * qualUrlList.length / validNames.length);
  10065. const end = Math.floor((idx + 1) * qualUrlList.length / validNames.length);
  10066. this.$set(this.qualifications, name, qualUrlList.slice(start, end));
  10067. this.$set(this.qualOssIds, name, qualOssIdList.slice(start, end));
  10068. });
  10069. }
  10070. uni.hideLoading();
  10071. } catch (e) {
  10072. uni.hideLoading();
  10073. formatAppLog("error", "at pages/mine/settings/auth/edit.vue:177", "加载认证信息失败", e);
  10074. uni.showToast({ title: "加载失败", icon: "none" });
  10075. }
  10076. },
  10077. navBack() {
  10078. uni.navigateBack({ delta: 1 });
  10079. },
  10080. chooseImage(side) {
  10081. uni.chooseImage({
  10082. count: 1,
  10083. sizeType: ["compressed"],
  10084. sourceType: ["album", "camera"],
  10085. success: async (res) => {
  10086. const tempPath = res.tempFilePaths[0];
  10087. if (side === "front") {
  10088. this.idCardFront = tempPath;
  10089. } else {
  10090. this.idCardBack = tempPath;
  10091. }
  10092. try {
  10093. uni.showLoading({ title: "上传中..." });
  10094. const uploadRes = await uploadFile(tempPath);
  10095. if (side === "front") {
  10096. this.idCardFrontOssId = uploadRes.data.ossId;
  10097. } else {
  10098. this.idCardBackOssId = uploadRes.data.ossId;
  10099. }
  10100. uni.hideLoading();
  10101. uni.showToast({ title: "上传成功", icon: "success" });
  10102. } catch (err) {
  10103. uni.hideLoading();
  10104. formatAppLog("error", "at pages/mine/settings/auth/edit.vue:209", "上传身份证图片失败:", err);
  10105. uni.showToast({ title: "上传失败", icon: "none" });
  10106. }
  10107. }
  10108. });
  10109. },
  10110. deleteImage(side) {
  10111. if (side === "front") {
  10112. this.idCardFront = "";
  10113. this.idCardFrontOssId = "";
  10114. } else {
  10115. this.idCardBack = "";
  10116. this.idCardBackOssId = "";
  10117. }
  10118. },
  10119. getServiceName(serviceId) {
  10120. const found = this.serviceOptions.find((s) => String(s.id) === String(serviceId));
  10121. return found ? found.name : "";
  10122. },
  10123. toggleService(service) {
  10124. const index = this.selectedServices.indexOf(service.id);
  10125. if (index > -1) {
  10126. this.selectedServices.splice(index, 1);
  10127. this.$delete(this.qualifications, service.name);
  10128. this.$delete(this.qualOssIds, service.name);
  10129. } else {
  10130. this.selectedServices.push(service.id);
  10131. this.$set(this.qualifications, service.name, []);
  10132. this.$set(this.qualOssIds, service.name, []);
  10133. }
  10134. this.$forceUpdate();
  10135. },
  10136. chooseQualImage(service) {
  10137. uni.chooseImage({
  10138. count: 9,
  10139. sizeType: ["compressed"],
  10140. sourceType: ["album", "camera"],
  10141. success: async (res) => {
  10142. if (!this.qualifications[service]) {
  10143. this.qualifications[service] = [];
  10144. this.qualOssIds[service] = [];
  10145. }
  10146. for (const tempPath of res.tempFilePaths) {
  10147. this.qualifications[service].push(tempPath);
  10148. this.$forceUpdate();
  10149. try {
  10150. uni.showLoading({ title: "上传中..." });
  10151. const uploadRes = await uploadFile(tempPath);
  10152. this.qualOssIds[service].push(uploadRes.data.ossId);
  10153. uni.hideLoading();
  10154. } catch (err) {
  10155. uni.hideLoading();
  10156. formatAppLog("error", "at pages/mine/settings/auth/edit.vue:263", "上传资质图片失败:", err);
  10157. }
  10158. }
  10159. }
  10160. });
  10161. },
  10162. deleteQualImage(service, index) {
  10163. this.qualifications[service].splice(index, 1);
  10164. if (this.qualOssIds[service]) {
  10165. this.qualOssIds[service].splice(index, 1);
  10166. }
  10167. this.$forceUpdate();
  10168. },
  10169. previewImage(service, index) {
  10170. uni.previewImage({
  10171. urls: this.qualifications[service],
  10172. current: index
  10173. });
  10174. },
  10175. async submitAuth() {
  10176. if (!this.idCardFront || !this.idCardBack) {
  10177. uni.showToast({ title: "请上传身份证正反面", icon: "none" });
  10178. return;
  10179. }
  10180. if (this.selectedServices.length === 0) {
  10181. uni.showToast({ title: "请选择服务类型", icon: "none" });
  10182. return;
  10183. }
  10184. for (const serviceId of this.selectedServices) {
  10185. const name = this.getServiceName(serviceId);
  10186. if (!this.qualifications[name] || this.qualifications[name].length === 0) {
  10187. uni.showToast({ title: `请上传${name}资质`, icon: "none" });
  10188. return;
  10189. }
  10190. }
  10191. uni.showModal({
  10192. title: "提示",
  10193. content: "修改认证信息需要重新审核,审核期间无法接单,确定要继续吗?",
  10194. success: (res) => {
  10195. if (res.confirm) {
  10196. this.doSubmit();
  10197. }
  10198. }
  10199. });
  10200. },
  10201. async doSubmit() {
  10202. const allQualOssIds = [];
  10203. Object.values(this.qualOssIds).forEach((ids) => {
  10204. allQualOssIds.push(...ids);
  10205. });
  10206. const submitData = {
  10207. idCardFront: this.idCardFrontOssId,
  10208. idCardBack: this.idCardBackOssId,
  10209. serviceTypes: this.selectedServices.join(","),
  10210. // 逗号分隔的服务类型ID
  10211. qualifications: allQualOssIds.join(",")
  10212. // 逗号分隔的资质图片OSS ID
  10213. };
  10214. try {
  10215. uni.showLoading({ title: "提交中..." });
  10216. await updateAuthInfo(submitData);
  10217. uni.hideLoading();
  10218. uni.showToast({ title: "提交成功,等待审核", icon: "success", duration: 1500 });
  10219. setTimeout(() => {
  10220. uni.navigateBack({ delta: 1 });
  10221. }, 1500);
  10222. } catch (err) {
  10223. uni.hideLoading();
  10224. formatAppLog("error", "at pages/mine/settings/auth/edit.vue:334", "提交失败:", err);
  10225. uni.showToast({ title: "提交失败", icon: "none" });
  10226. }
  10227. }
  10228. }
  10229. };
  10230. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  10231. return vue.openBlock(), vue.createElementBlock("view", { class: "edit-auth-container" }, [
  10232. vue.createElementVNode("view", { class: "custom-header" }, [
  10233. vue.createElementVNode("view", {
  10234. class: "header-left",
  10235. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10236. }, [
  10237. vue.createElementVNode("image", {
  10238. class: "back-icon",
  10239. src: _imports_0,
  10240. style: { "transform": "rotate(180deg)" }
  10241. })
  10242. ]),
  10243. vue.createElementVNode("text", { class: "header-title" }, "修改认证信息"),
  10244. vue.createElementVNode("view", { class: "header-right" })
  10245. ]),
  10246. vue.createElementVNode("view", { class: "header-placeholder" }),
  10247. vue.createElementVNode("view", { class: "warning-tip" }, [
  10248. vue.createElementVNode("text", { class: "warning-icon" }, "⚠"),
  10249. vue.createElementVNode("text", { class: "warning-text" }, "若修改认证信息,将在审核通过后生效")
  10250. ]),
  10251. vue.createElementVNode("view", { class: "section-card" }, [
  10252. vue.createElementVNode("view", { class: "section-title" }, "身份认证"),
  10253. vue.createElementVNode("text", { class: "section-subtitle" }, "点击图片修改"),
  10254. vue.createElementVNode("view", { class: "id-card-row" }, [
  10255. vue.createElementVNode("view", {
  10256. class: "id-card-upload",
  10257. onClick: _cache[2] || (_cache[2] = ($event) => $options.chooseImage("front"))
  10258. }, [
  10259. $data.idCardFront ? (vue.openBlock(), vue.createElementBlock("image", {
  10260. key: 0,
  10261. src: $data.idCardFront,
  10262. class: "id-card-img",
  10263. mode: "aspectFill"
  10264. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("view", {
  10265. key: 1,
  10266. class: "id-card-placeholder"
  10267. }, [
  10268. vue.createElementVNode("text", { class: "placeholder-text" }, "ID Front")
  10269. ])),
  10270. $data.idCardFront ? (vue.openBlock(), vue.createElementBlock("view", {
  10271. key: 2,
  10272. class: "delete-btn",
  10273. onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => $options.deleteImage("front"), ["stop"]))
  10274. }, "×")) : vue.createCommentVNode("v-if", true),
  10275. vue.createElementVNode("view", { class: "corner-tag" }, "人像面")
  10276. ]),
  10277. vue.createElementVNode("view", {
  10278. class: "id-card-upload",
  10279. onClick: _cache[4] || (_cache[4] = ($event) => $options.chooseImage("back"))
  10280. }, [
  10281. $data.idCardBack ? (vue.openBlock(), vue.createElementBlock("image", {
  10282. key: 0,
  10283. src: $data.idCardBack,
  10284. class: "id-card-img",
  10285. mode: "aspectFill"
  10286. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("view", {
  10287. key: 1,
  10288. class: "id-card-placeholder"
  10289. }, [
  10290. vue.createElementVNode("text", { class: "placeholder-text" }, "ID Back")
  10291. ])),
  10292. $data.idCardBack ? (vue.openBlock(), vue.createElementBlock("view", {
  10293. key: 2,
  10294. class: "delete-btn",
  10295. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => $options.deleteImage("back"), ["stop"]))
  10296. }, "×")) : vue.createCommentVNode("v-if", true),
  10297. vue.createElementVNode("view", { class: "corner-tag" }, "国徽面")
  10298. ])
  10299. ])
  10300. ]),
  10301. vue.createElementVNode("view", { class: "section-card" }, [
  10302. vue.createElementVNode("view", { class: "section-title" }, "服务类型"),
  10303. vue.createElementVNode("text", { class: "section-subtitle" }, "可多选"),
  10304. vue.createElementVNode("view", { class: "service-list" }, [
  10305. (vue.openBlock(true), vue.createElementBlock(
  10306. vue.Fragment,
  10307. null,
  10308. vue.renderList($data.serviceOptions, (service, index) => {
  10309. return vue.openBlock(), vue.createElementBlock("view", {
  10310. class: "service-item",
  10311. key: service.id,
  10312. onClick: ($event) => $options.toggleService(service)
  10313. }, [
  10314. vue.createElementVNode(
  10315. "text",
  10316. { class: "service-name" },
  10317. vue.toDisplayString(service.name),
  10318. 1
  10319. /* TEXT */
  10320. ),
  10321. vue.createElementVNode(
  10322. "view",
  10323. {
  10324. class: vue.normalizeClass(["check-icon", { active: $data.selectedServices.map(String).includes(String(service.id)) }])
  10325. },
  10326. [
  10327. $data.selectedServices.map(String).includes(String(service.id)) ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "✓")) : vue.createCommentVNode("v-if", true)
  10328. ],
  10329. 2
  10330. /* CLASS */
  10331. )
  10332. ], 8, ["onClick"]);
  10333. }),
  10334. 128
  10335. /* KEYED_FRAGMENT */
  10336. ))
  10337. ])
  10338. ]),
  10339. vue.createElementVNode("view", { class: "section-card" }, [
  10340. vue.createElementVNode("view", { class: "section-title" }, "资质证书"),
  10341. vue.createElementVNode("text", { class: "section-subtitle" }, "请上传对应服务的资质"),
  10342. (vue.openBlock(true), vue.createElementBlock(
  10343. vue.Fragment,
  10344. null,
  10345. vue.renderList($data.selectedServices, (serviceId, index) => {
  10346. return vue.openBlock(), vue.createElementBlock("view", {
  10347. key: serviceId,
  10348. class: "qual-section"
  10349. }, [
  10350. vue.createElementVNode(
  10351. "text",
  10352. { class: "qual-title" },
  10353. vue.toDisplayString($options.getServiceName(serviceId)) + "资质",
  10354. 1
  10355. /* TEXT */
  10356. ),
  10357. vue.createElementVNode("view", { class: "qual-upload-row" }, [
  10358. (vue.openBlock(true), vue.createElementBlock(
  10359. vue.Fragment,
  10360. null,
  10361. vue.renderList($data.qualifications[$options.getServiceName(serviceId)], (img, imgIndex) => {
  10362. return vue.openBlock(), vue.createElementBlock("view", {
  10363. class: "qual-item",
  10364. key: imgIndex,
  10365. onClick: ($event) => $options.previewImage($options.getServiceName(serviceId), imgIndex)
  10366. }, [
  10367. vue.createElementVNode("image", {
  10368. src: img,
  10369. class: "qual-img",
  10370. mode: "aspectFill"
  10371. }, null, 8, ["src"]),
  10372. vue.createElementVNode("view", {
  10373. class: "delete-btn",
  10374. onClick: vue.withModifiers(($event) => $options.deleteQualImage($options.getServiceName(serviceId), imgIndex), ["stop"])
  10375. }, "×", 8, ["onClick"])
  10376. ], 8, ["onClick"]);
  10377. }),
  10378. 128
  10379. /* KEYED_FRAGMENT */
  10380. )),
  10381. vue.createElementVNode("view", {
  10382. class: "qual-upload-btn",
  10383. onClick: ($event) => $options.chooseQualImage($options.getServiceName(serviceId))
  10384. }, [
  10385. vue.createElementVNode("text", { class: "plus-icon" }, "+")
  10386. ], 8, ["onClick"])
  10387. ])
  10388. ]);
  10389. }),
  10390. 128
  10391. /* KEYED_FRAGMENT */
  10392. )),
  10393. $data.selectedServices.length === 0 ? (vue.openBlock(), vue.createElementBlock("text", {
  10394. key: 0,
  10395. class: "empty-hint"
  10396. }, "请先选择服务类型")) : vue.createCommentVNode("v-if", true)
  10397. ]),
  10398. vue.createElementVNode("view", { class: "bottom-btn-area" }, [
  10399. vue.createElementVNode("button", {
  10400. class: "submit-btn",
  10401. onClick: _cache[5] || (_cache[5] = (...args) => $options.submitAuth && $options.submitAuth(...args))
  10402. }, "提交审核")
  10403. ])
  10404. ]);
  10405. }
  10406. const PagesMineSettingsAuthEdit = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-10d0f207"], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/auth/edit.vue"]]);
  10407. const _imports_1$4 = "/static/icons/shield.svg";
  10408. const _sfc_main$h = {
  10409. data() {
  10410. return {
  10411. hasShieldIcon: false
  10412. // 如果没有盾牌图标资源,暂时隐藏或用文字代替
  10413. };
  10414. },
  10415. methods: {
  10416. navBack() {
  10417. uni.navigateBack({
  10418. delta: 1
  10419. });
  10420. },
  10421. editBank() {
  10422. uni.showToast({ title: "跳转修改银行卡页", icon: "none" });
  10423. }
  10424. }
  10425. };
  10426. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  10427. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10428. vue.createElementVNode("view", { class: "custom-header" }, [
  10429. vue.createElementVNode("view", {
  10430. class: "header-left",
  10431. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10432. }, [
  10433. vue.createElementVNode("image", {
  10434. class: "back-icon",
  10435. src: _imports_0,
  10436. style: { "transform": "rotate(180deg)" }
  10437. })
  10438. ]),
  10439. vue.createElementVNode("text", { class: "header-title" }, "银行卡信息"),
  10440. vue.createElementVNode("view", { class: "header-right" })
  10441. ]),
  10442. vue.createElementVNode("view", { class: "header-placeholder" }),
  10443. vue.createElementVNode("view", { class: "bank-card" }, [
  10444. vue.createElementVNode("view", { class: "card-top" }, [
  10445. vue.createElementVNode("view", { class: "bank-info" }, [
  10446. vue.createElementVNode("view", { class: "bank-icon-circle" }, [
  10447. vue.createElementVNode("text", { class: "bank-icon-text" }, "招")
  10448. ]),
  10449. vue.createElementVNode("text", { class: "bank-name" }, "招商银行")
  10450. ]),
  10451. vue.createElementVNode("view", { class: "card-type" }, "储蓄卡")
  10452. ]),
  10453. vue.createElementVNode("view", { class: "card-number" }, "622588******1234"),
  10454. vue.createElementVNode("view", { class: "card-bg-circle" })
  10455. ]),
  10456. vue.createElementVNode("button", {
  10457. class: "action-btn",
  10458. onClick: _cache[1] || (_cache[1] = (...args) => $options.editBank && $options.editBank(...args))
  10459. }, "修改银行卡信息"),
  10460. vue.createElementVNode("view", { class: "security-tip" }, [
  10461. $data.hasShieldIcon ? (vue.openBlock(), vue.createElementBlock("image", {
  10462. key: 0,
  10463. class: "shield-icon",
  10464. src: _imports_1$4
  10465. })) : vue.createCommentVNode("v-if", true),
  10466. vue.createElementVNode("text", null, "信息已加密,仅用于收入发放")
  10467. ])
  10468. ]);
  10469. }
  10470. const PagesMineSettingsBankIndex = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/bank/index.vue"]]);
  10471. const _sfc_main$g = {
  10472. data() {
  10473. return {
  10474. phone: "",
  10475. hasPassword: false
  10476. };
  10477. },
  10478. onLoad() {
  10479. this.loadProfile();
  10480. },
  10481. methods: {
  10482. navBack() {
  10483. uni.navigateBack({
  10484. delta: 1
  10485. });
  10486. },
  10487. async loadProfile() {
  10488. try {
  10489. const res = await getMyProfile();
  10490. if (res.code === 200 && res.data) {
  10491. this.phone = res.data.phone || "";
  10492. this.hasPassword = !!res.data.hasPassword;
  10493. }
  10494. } catch (e) {
  10495. formatAppLog("error", "at pages/mine/settings/security/index.vue:68", "加载个人信息失败", e);
  10496. }
  10497. },
  10498. maskPhone(phone) {
  10499. if (!phone || phone.length < 11)
  10500. return phone;
  10501. return phone.substring(0, 3) + "****" + phone.substring(7);
  10502. },
  10503. changeMobile() {
  10504. uni.navigateTo({
  10505. url: "/pages/mine/settings/security/change-phone"
  10506. });
  10507. },
  10508. changePassword() {
  10509. uni.navigateTo({
  10510. url: "/pages/mine/settings/security/change-password"
  10511. });
  10512. },
  10513. async deleteAccount() {
  10514. uni.showModal({
  10515. title: "警示",
  10516. content: "注销账号后将无法恢复,确定要继续吗?",
  10517. success: async (res) => {
  10518. if (res.confirm) {
  10519. try {
  10520. const result = await deleteAccount();
  10521. if (result.code === 200) {
  10522. uni.showToast({ title: "账号已注销", icon: "success" });
  10523. setTimeout(() => {
  10524. uni.reLaunch({ url: "/pages/login/login" });
  10525. }, 1500);
  10526. } else {
  10527. uni.showToast({ title: result.msg || "注销失败", icon: "none" });
  10528. }
  10529. } catch (e) {
  10530. formatAppLog("error", "at pages/mine/settings/security/index.vue:102", "注销账号失败", e);
  10531. uni.showToast({ title: "注销失败", icon: "none" });
  10532. }
  10533. }
  10534. }
  10535. });
  10536. }
  10537. }
  10538. };
  10539. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  10540. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10541. vue.createElementVNode("view", { class: "custom-header" }, [
  10542. vue.createElementVNode("view", {
  10543. class: "header-left",
  10544. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10545. }, [
  10546. vue.createElementVNode("image", {
  10547. class: "back-icon",
  10548. src: _imports_0,
  10549. style: { "transform": "rotate(180deg)" }
  10550. })
  10551. ]),
  10552. vue.createElementVNode("text", { class: "header-title" }, "账号与安全"),
  10553. vue.createElementVNode("view", { class: "header-right" })
  10554. ]),
  10555. vue.createElementVNode("view", { class: "header-placeholder" }),
  10556. vue.createElementVNode("view", { class: "section-title-security" }, "安全设置"),
  10557. vue.createElementVNode("view", { class: "group-card" }, [
  10558. vue.createElementVNode("view", {
  10559. class: "list-item",
  10560. onClick: _cache[1] || (_cache[1] = (...args) => $options.changeMobile && $options.changeMobile(...args))
  10561. }, [
  10562. vue.createElementVNode("text", { class: "item-title" }, "手机号"),
  10563. vue.createElementVNode("view", { class: "item-right" }, [
  10564. vue.createElementVNode(
  10565. "text",
  10566. { class: "item-value" },
  10567. vue.toDisplayString($options.maskPhone($data.phone) || "未设置"),
  10568. 1
  10569. /* TEXT */
  10570. ),
  10571. vue.createElementVNode("image", {
  10572. class: "arrow-icon",
  10573. src: _imports_3
  10574. })
  10575. ])
  10576. ]),
  10577. vue.createElementVNode("view", {
  10578. class: "list-item",
  10579. onClick: _cache[2] || (_cache[2] = (...args) => $options.changePassword && $options.changePassword(...args))
  10580. }, [
  10581. vue.createElementVNode("text", { class: "item-title" }, "登录密码"),
  10582. vue.createElementVNode("view", { class: "item-right" }, [
  10583. vue.createElementVNode(
  10584. "text",
  10585. { class: "item-value" },
  10586. vue.toDisplayString($data.hasPassword ? "已设置" : "未设置"),
  10587. 1
  10588. /* TEXT */
  10589. ),
  10590. vue.createElementVNode("image", {
  10591. class: "arrow-icon",
  10592. src: _imports_3
  10593. })
  10594. ])
  10595. ])
  10596. ]),
  10597. vue.createElementVNode("view", { class: "section-title-security" }, "高级设置"),
  10598. vue.createElementVNode("view", { class: "group-card" }, [
  10599. vue.createElementVNode("view", {
  10600. class: "list-item no-border",
  10601. onClick: _cache[3] || (_cache[3] = (...args) => $options.deleteAccount && $options.deleteAccount(...args))
  10602. }, [
  10603. vue.createElementVNode("text", { class: "item-title" }, "注销账号"),
  10604. vue.createElementVNode("image", {
  10605. class: "arrow-icon",
  10606. src: _imports_3
  10607. })
  10608. ])
  10609. ])
  10610. ]);
  10611. }
  10612. const PagesMineSettingsSecurityIndex = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/security/index.vue"]]);
  10613. const _sfc_main$f = {
  10614. data() {
  10615. return {
  10616. name: ""
  10617. };
  10618. },
  10619. onLoad(options) {
  10620. if (options.name) {
  10621. this.name = decodeURIComponent(options.name);
  10622. }
  10623. },
  10624. methods: {
  10625. navBack() {
  10626. uni.navigateBack({ delta: 1 });
  10627. },
  10628. // 提交修改 @author steelwei
  10629. async submitChange() {
  10630. if (!this.name || !this.name.trim()) {
  10631. uni.showToast({ title: "请输入姓名", icon: "none" });
  10632. return;
  10633. }
  10634. if (this.name.trim().length < 2) {
  10635. uni.showToast({ title: "姓名至少2个字符", icon: "none" });
  10636. return;
  10637. }
  10638. uni.showLoading({ title: "提交中..." });
  10639. try {
  10640. const res = await updateName(this.name.trim());
  10641. if (res.code === 200) {
  10642. uni.showToast({
  10643. title: "修改成功",
  10644. icon: "success",
  10645. duration: 2e3
  10646. });
  10647. uni.$emit("updateName", this.name.trim());
  10648. setTimeout(() => {
  10649. uni.navigateBack({ delta: 1 });
  10650. }, 2e3);
  10651. } else {
  10652. uni.showToast({
  10653. title: res.msg || "修改失败",
  10654. icon: "none"
  10655. });
  10656. }
  10657. } catch (error) {
  10658. formatAppLog("error", "at pages/mine/settings/profile/edit-name.vue:94", "修改姓名失败:", error);
  10659. uni.showToast({ title: "网络错误", icon: "none" });
  10660. } finally {
  10661. uni.hideLoading();
  10662. }
  10663. }
  10664. }
  10665. };
  10666. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  10667. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10668. vue.createElementVNode("view", { class: "custom-header" }, [
  10669. vue.createElementVNode("view", {
  10670. class: "header-left",
  10671. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10672. }, [
  10673. vue.createElementVNode("image", {
  10674. class: "back-icon",
  10675. src: _imports_0,
  10676. style: { "transform": "rotate(180deg)" }
  10677. })
  10678. ]),
  10679. vue.createElementVNode("text", { class: "header-title" }, "修改姓名"),
  10680. vue.createElementVNode("view", { class: "header-right" })
  10681. ]),
  10682. vue.createElementVNode("view", { class: "header-placeholder" }),
  10683. vue.createElementVNode("view", { class: "form-card" }, [
  10684. vue.createElementVNode("view", { class: "form-item no-border" }, [
  10685. vue.createElementVNode("text", { class: "form-label" }, "真实姓名"),
  10686. vue.withDirectives(vue.createElementVNode(
  10687. "input",
  10688. {
  10689. class: "form-input",
  10690. type: "text",
  10691. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.name = $event),
  10692. placeholder: "请输入真实姓名",
  10693. "placeholder-class": "placeholder",
  10694. maxlength: "20"
  10695. },
  10696. null,
  10697. 512
  10698. /* NEED_PATCH */
  10699. ), [
  10700. [vue.vModelText, $data.name]
  10701. ])
  10702. ])
  10703. ]),
  10704. vue.createElementVNode("view", { class: "btn-area" }, [
  10705. vue.createElementVNode("button", {
  10706. class: "submit-btn",
  10707. onClick: _cache[2] || (_cache[2] = (...args) => $options.submitChange && $options.submitChange(...args))
  10708. }, "确认修改")
  10709. ]),
  10710. vue.createElementVNode("view", { class: "tips" }, [
  10711. vue.createElementVNode("text", { class: "tips-text" }, "• 请输入您的真实姓名"),
  10712. vue.createElementVNode("text", { class: "tips-text" }, "• 姓名将用于实名认证和订单服务")
  10713. ])
  10714. ]);
  10715. }
  10716. const PagesMineSettingsProfileEditName = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/profile/edit-name.vue"]]);
  10717. const _sfc_main$e = {
  10718. data() {
  10719. return {
  10720. oldPassword: "",
  10721. newPassword: "",
  10722. confirmPassword: ""
  10723. };
  10724. },
  10725. methods: {
  10726. navBack() {
  10727. uni.navigateBack({ delta: 1 });
  10728. },
  10729. // 提交修改 @author steelwei
  10730. async submitChange() {
  10731. if (!this.oldPassword) {
  10732. uni.showToast({ title: "请输入旧密码", icon: "none" });
  10733. return;
  10734. }
  10735. if (!this.newPassword) {
  10736. uni.showToast({ title: "请输入新密码", icon: "none" });
  10737. return;
  10738. }
  10739. if (this.newPassword.length < 6 || this.newPassword.length > 20) {
  10740. uni.showToast({ title: "密码长度为6-20位", icon: "none" });
  10741. return;
  10742. }
  10743. if (this.newPassword !== this.confirmPassword) {
  10744. uni.showToast({ title: "两次密码输入不一致", icon: "none" });
  10745. return;
  10746. }
  10747. uni.showLoading({ title: "提交中..." });
  10748. try {
  10749. const res = await updatePassword(this.oldPassword, this.newPassword);
  10750. if (res.code === 200) {
  10751. uni.showToast({
  10752. title: "修改成功",
  10753. icon: "success",
  10754. duration: 2e3
  10755. });
  10756. setTimeout(() => {
  10757. uni.navigateBack({ delta: 1 });
  10758. }, 2e3);
  10759. } else {
  10760. uni.showToast({
  10761. title: res.msg || "修改失败",
  10762. icon: "none"
  10763. });
  10764. }
  10765. } catch (error) {
  10766. formatAppLog("error", "at pages/mine/settings/security/change-password.vue:109", "修改密码失败:", error);
  10767. uni.showToast({ title: "网络错误", icon: "none" });
  10768. } finally {
  10769. uni.hideLoading();
  10770. }
  10771. }
  10772. }
  10773. };
  10774. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  10775. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10776. vue.createElementVNode("view", { class: "custom-header" }, [
  10777. vue.createElementVNode("view", {
  10778. class: "header-left",
  10779. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10780. }, [
  10781. vue.createElementVNode("image", {
  10782. class: "back-icon",
  10783. src: _imports_0,
  10784. style: { "transform": "rotate(180deg)" }
  10785. })
  10786. ]),
  10787. vue.createElementVNode("text", { class: "header-title" }, "修改密码"),
  10788. vue.createElementVNode("view", { class: "header-right" })
  10789. ]),
  10790. vue.createElementVNode("view", { class: "header-placeholder" }),
  10791. vue.createElementVNode("view", { class: "form-card" }, [
  10792. vue.createElementVNode("view", { class: "form-item" }, [
  10793. vue.createElementVNode("text", { class: "form-label" }, "旧密码"),
  10794. vue.withDirectives(vue.createElementVNode(
  10795. "input",
  10796. {
  10797. class: "form-input",
  10798. type: "password",
  10799. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.oldPassword = $event),
  10800. placeholder: "请输入旧密码",
  10801. "placeholder-class": "placeholder"
  10802. },
  10803. null,
  10804. 512
  10805. /* NEED_PATCH */
  10806. ), [
  10807. [vue.vModelText, $data.oldPassword]
  10808. ])
  10809. ]),
  10810. vue.createElementVNode("view", { class: "form-item" }, [
  10811. vue.createElementVNode("text", { class: "form-label" }, "新密码"),
  10812. vue.withDirectives(vue.createElementVNode(
  10813. "input",
  10814. {
  10815. class: "form-input",
  10816. type: "password",
  10817. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.newPassword = $event),
  10818. placeholder: "请输入新密码(6-20位)",
  10819. "placeholder-class": "placeholder"
  10820. },
  10821. null,
  10822. 512
  10823. /* NEED_PATCH */
  10824. ), [
  10825. [vue.vModelText, $data.newPassword]
  10826. ])
  10827. ]),
  10828. vue.createElementVNode("view", { class: "form-item no-border" }, [
  10829. vue.createElementVNode("text", { class: "form-label" }, "确认密码"),
  10830. vue.withDirectives(vue.createElementVNode(
  10831. "input",
  10832. {
  10833. class: "form-input",
  10834. type: "password",
  10835. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.confirmPassword = $event),
  10836. placeholder: "请再次输入新密码",
  10837. "placeholder-class": "placeholder"
  10838. },
  10839. null,
  10840. 512
  10841. /* NEED_PATCH */
  10842. ), [
  10843. [vue.vModelText, $data.confirmPassword]
  10844. ])
  10845. ])
  10846. ]),
  10847. vue.createElementVNode("view", { class: "btn-area" }, [
  10848. vue.createElementVNode("button", {
  10849. class: "submit-btn",
  10850. onClick: _cache[4] || (_cache[4] = (...args) => $options.submitChange && $options.submitChange(...args))
  10851. }, "确认修改")
  10852. ])
  10853. ]);
  10854. }
  10855. const PagesMineSettingsSecurityChangePassword = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/security/change-password.vue"]]);
  10856. const _sfc_main$d = {
  10857. data() {
  10858. return {
  10859. phone: "",
  10860. code: "",
  10861. countdown: 0,
  10862. timer: null
  10863. };
  10864. },
  10865. onUnload() {
  10866. if (this.timer) {
  10867. clearInterval(this.timer);
  10868. }
  10869. },
  10870. methods: {
  10871. navBack() {
  10872. uni.navigateBack({ delta: 1 });
  10873. },
  10874. // 发送验证码 @author steelwei
  10875. sendCode() {
  10876. if (!this.phone) {
  10877. uni.showToast({ title: "请输入手机号", icon: "none" });
  10878. return;
  10879. }
  10880. if (!/^1[3-9]\d{9}$/.test(this.phone)) {
  10881. uni.showToast({ title: "手机号格式不正确", icon: "none" });
  10882. return;
  10883. }
  10884. uni.showToast({ title: "验证码已发送", icon: "success" });
  10885. this.countdown = 60;
  10886. this.timer = setInterval(() => {
  10887. this.countdown--;
  10888. if (this.countdown <= 0) {
  10889. clearInterval(this.timer);
  10890. }
  10891. }, 1e3);
  10892. },
  10893. // 提交修改 @author steelwei
  10894. async submitChange() {
  10895. if (!this.phone) {
  10896. uni.showToast({ title: "请输入手机号", icon: "none" });
  10897. return;
  10898. }
  10899. if (!/^1[3-9]\d{9}$/.test(this.phone)) {
  10900. uni.showToast({ title: "手机号格式不正确", icon: "none" });
  10901. return;
  10902. }
  10903. if (!this.code) {
  10904. uni.showToast({ title: "请输入验证码", icon: "none" });
  10905. return;
  10906. }
  10907. uni.showLoading({ title: "提交中..." });
  10908. try {
  10909. const res = await updatePhone(this.phone, this.code);
  10910. if (res.code === 200) {
  10911. uni.showToast({
  10912. title: "修改成功",
  10913. icon: "success",
  10914. duration: 2e3
  10915. });
  10916. setTimeout(() => {
  10917. uni.navigateBack({ delta: 1 });
  10918. }, 2e3);
  10919. } else {
  10920. uni.showToast({
  10921. title: res.msg || "修改失败",
  10922. icon: "none"
  10923. });
  10924. }
  10925. } catch (error) {
  10926. formatAppLog("error", "at pages/mine/settings/security/change-phone.vue:139", "修改手机号失败:", error);
  10927. uni.showToast({ title: "网络错误", icon: "none" });
  10928. } finally {
  10929. uni.hideLoading();
  10930. }
  10931. }
  10932. }
  10933. };
  10934. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  10935. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10936. vue.createElementVNode("view", { class: "custom-header" }, [
  10937. vue.createElementVNode("view", {
  10938. class: "header-left",
  10939. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  10940. }, [
  10941. vue.createElementVNode("image", {
  10942. class: "back-icon",
  10943. src: _imports_0,
  10944. style: { "transform": "rotate(180deg)" }
  10945. })
  10946. ]),
  10947. vue.createElementVNode("text", { class: "header-title" }, "修改手机号"),
  10948. vue.createElementVNode("view", { class: "header-right" })
  10949. ]),
  10950. vue.createElementVNode("view", { class: "header-placeholder" }),
  10951. vue.createElementVNode("view", { class: "form-card" }, [
  10952. vue.createElementVNode("view", { class: "form-item" }, [
  10953. vue.createElementVNode("text", { class: "form-label" }, "新手机号"),
  10954. vue.withDirectives(vue.createElementVNode(
  10955. "input",
  10956. {
  10957. class: "form-input",
  10958. type: "number",
  10959. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.phone = $event),
  10960. placeholder: "请输入新手机号",
  10961. "placeholder-class": "placeholder",
  10962. maxlength: "11"
  10963. },
  10964. null,
  10965. 512
  10966. /* NEED_PATCH */
  10967. ), [
  10968. [vue.vModelText, $data.phone]
  10969. ])
  10970. ]),
  10971. vue.createElementVNode("view", { class: "form-item no-border" }, [
  10972. vue.createElementVNode("text", { class: "form-label" }, "验证码"),
  10973. vue.withDirectives(vue.createElementVNode(
  10974. "input",
  10975. {
  10976. class: "form-input",
  10977. type: "number",
  10978. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.code = $event),
  10979. placeholder: "请输入验证码",
  10980. "placeholder-class": "placeholder",
  10981. maxlength: "6"
  10982. },
  10983. null,
  10984. 512
  10985. /* NEED_PATCH */
  10986. ), [
  10987. [vue.vModelText, $data.code]
  10988. ]),
  10989. vue.createElementVNode("button", {
  10990. class: "code-btn",
  10991. disabled: $data.countdown > 0,
  10992. onClick: _cache[3] || (_cache[3] = (...args) => $options.sendCode && $options.sendCode(...args))
  10993. }, vue.toDisplayString($data.countdown > 0 ? `${$data.countdown}s` : "获取验证码"), 9, ["disabled"])
  10994. ])
  10995. ]),
  10996. vue.createElementVNode("view", { class: "btn-area" }, [
  10997. vue.createElementVNode("button", {
  10998. class: "submit-btn",
  10999. onClick: _cache[4] || (_cache[4] = (...args) => $options.submitChange && $options.submitChange(...args))
  11000. }, "确认修改")
  11001. ]),
  11002. vue.createElementVNode("view", { class: "tips" }, [
  11003. vue.createElementVNode("text", { class: "tips-text" }, "• 修改手机号后,新手机号将作为登录账号"),
  11004. vue.createElementVNode("text", { class: "tips-text" }, "• 请确保新手机号可以正常接收短信")
  11005. ])
  11006. ]);
  11007. }
  11008. const PagesMineSettingsSecurityChangePhone = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/security/change-phone.vue"]]);
  11009. const _sfc_main$c = {
  11010. data() {
  11011. return {};
  11012. },
  11013. methods: {
  11014. navBack() {
  11015. uni.navigateBack({
  11016. delta: 1
  11017. });
  11018. },
  11019. switchChange(type, e) {
  11020. formatAppLog("log", "at pages/mine/settings/notification/index.vue:41", "switch change", type, e.detail.value);
  11021. }
  11022. }
  11023. };
  11024. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  11025. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11026. vue.createElementVNode("view", { class: "custom-header" }, [
  11027. vue.createElementVNode("view", {
  11028. class: "header-left",
  11029. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  11030. }, [
  11031. vue.createElementVNode("image", {
  11032. class: "back-icon",
  11033. src: _imports_0,
  11034. style: { "transform": "rotate(180deg)" }
  11035. })
  11036. ]),
  11037. vue.createElementVNode("text", { class: "header-title" }, "推送通知设置"),
  11038. vue.createElementVNode("view", { class: "header-right" })
  11039. ]),
  11040. vue.createElementVNode("view", { class: "header-placeholder" }),
  11041. vue.createElementVNode("view", { class: "group-card" }, [
  11042. vue.createElementVNode("view", { class: "list-item" }, [
  11043. vue.createElementVNode("text", { class: "item-title" }, "系统消息通知"),
  11044. vue.createElementVNode(
  11045. "switch",
  11046. {
  11047. checked: "",
  11048. color: "#FF5722",
  11049. style: { "transform": "scale(0.8)" },
  11050. onChange: _cache[1] || (_cache[1] = ($event) => $options.switchChange("system", $event))
  11051. },
  11052. null,
  11053. 32
  11054. /* NEED_HYDRATION */
  11055. )
  11056. ]),
  11057. vue.createElementVNode("view", { class: "list-item no-border" }, [
  11058. vue.createElementVNode("text", { class: "item-title" }, "订单消息通知"),
  11059. vue.createElementVNode(
  11060. "switch",
  11061. {
  11062. checked: "",
  11063. color: "#FF5722",
  11064. style: { "transform": "scale(0.8)" },
  11065. onChange: _cache[2] || (_cache[2] = ($event) => $options.switchChange("order", $event))
  11066. },
  11067. null,
  11068. 32
  11069. /* NEED_HYDRATION */
  11070. )
  11071. ])
  11072. ]),
  11073. vue.createElementVNode("text", { class: "tips-text" }, "关闭通知后将收不到消息通知推送")
  11074. ]);
  11075. }
  11076. const PagesMineSettingsNotificationIndex = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/notification/index.vue"]]);
  11077. const _imports_1$3 = "/static/logo.png";
  11078. const _sfc_main$b = {
  11079. data() {
  11080. return {
  11081. version: "2.0.6"
  11082. };
  11083. },
  11084. onLoad() {
  11085. this.getAppVersion();
  11086. },
  11087. methods: {
  11088. navBack() {
  11089. uni.navigateBack({
  11090. delta: 1
  11091. });
  11092. },
  11093. goToDetail(id) {
  11094. uni.navigateTo({
  11095. url: `/pages/mine/settings/about/agreement-detail?id=${id}`
  11096. });
  11097. },
  11098. checkUpdate() {
  11099. uni.showToast({ title: "已是最新版本", icon: "none" });
  11100. },
  11101. getAppVersion() {
  11102. plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
  11103. this.version = widgetInfo.version || "2.0.6";
  11104. });
  11105. }
  11106. }
  11107. };
  11108. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  11109. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11110. vue.createElementVNode("view", { class: "custom-header" }, [
  11111. vue.createElementVNode("view", {
  11112. class: "header-left",
  11113. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  11114. }, [
  11115. vue.createElementVNode("image", {
  11116. class: "back-icon",
  11117. src: _imports_0,
  11118. style: { "transform": "rotate(180deg)" }
  11119. })
  11120. ]),
  11121. vue.createElementVNode("text", { class: "header-title" }, "关于我们"),
  11122. vue.createElementVNode("view", { class: "header-right" })
  11123. ]),
  11124. vue.createElementVNode("view", { class: "header-placeholder" }),
  11125. vue.createElementVNode("view", { class: "logo-area" }, [
  11126. vue.createElementVNode("image", {
  11127. class: "app-logo",
  11128. src: _imports_1$3,
  11129. mode: "aspectFit"
  11130. }),
  11131. vue.createElementVNode("text", { class: "app-name" }, "履约者"),
  11132. vue.createElementVNode(
  11133. "text",
  11134. { class: "app-version" },
  11135. "Version " + vue.toDisplayString($data.version),
  11136. 1
  11137. /* TEXT */
  11138. )
  11139. ]),
  11140. vue.createElementVNode("view", { class: "group-card" }, [
  11141. vue.createElementVNode("view", {
  11142. class: "list-item",
  11143. onClick: _cache[1] || (_cache[1] = ($event) => $options.goToDetail(1))
  11144. }, [
  11145. vue.createElementVNode("text", { class: "item-title" }, "服务协议"),
  11146. vue.createElementVNode("image", {
  11147. class: "arrow-icon",
  11148. src: _imports_3
  11149. })
  11150. ]),
  11151. vue.createElementVNode("view", {
  11152. class: "list-item",
  11153. onClick: _cache[2] || (_cache[2] = ($event) => $options.goToDetail(2))
  11154. }, [
  11155. vue.createElementVNode("text", { class: "item-title" }, "隐私政策"),
  11156. vue.createElementVNode("image", {
  11157. class: "arrow-icon",
  11158. src: _imports_3
  11159. })
  11160. ])
  11161. ])
  11162. ]);
  11163. }
  11164. const PagesMineSettingsAboutIndex = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/about/index.vue"]]);
  11165. const _imports_1$2 = "/static/icons/wallet_white.svg";
  11166. const _imports_2$2 = "/static/icons/arrow_right_gray.svg";
  11167. const bizTypeMap$3 = fulfillerEnum.FlfBalanceBizType;
  11168. const _sfc_main$a = {
  11169. data() {
  11170. return {
  11171. balance: "0.00",
  11172. pendingBalance: "0.00",
  11173. currentTab: 0,
  11174. list: [],
  11175. pageNum: 1,
  11176. pageSize: 10,
  11177. total: 0,
  11178. loading: false
  11179. };
  11180. },
  11181. computed: {
  11182. displayList() {
  11183. if (this.currentTab === 0)
  11184. return this.list;
  11185. if (this.currentTab === 1)
  11186. return this.list.filter((item) => item.type === "income");
  11187. if (this.currentTab === 2)
  11188. return this.list.filter((item) => item.type === "expense");
  11189. return [];
  11190. }
  11191. },
  11192. onShow() {
  11193. this.fetchData();
  11194. this.fetchList(true);
  11195. },
  11196. onReachBottom() {
  11197. this.fetchList();
  11198. },
  11199. methods: {
  11200. async fetchData() {
  11201. try {
  11202. const res = await getBalanceOnApp();
  11203. if (res.code === 200 && res.data) {
  11204. this.balance = (res.data.balance / 100).toFixed(2);
  11205. this.pendingBalance = (res.data.pendingBalance / 100).toFixed(2);
  11206. }
  11207. } catch (error) {
  11208. formatAppLog("error", "at pages/mine/wallet/index.vue:135", "获取余额数据失败", error);
  11209. }
  11210. },
  11211. async fetchList(reset = false) {
  11212. if (reset) {
  11213. this.pageNum = 1;
  11214. this.list = [];
  11215. this.total = 0;
  11216. }
  11217. if (this.loading)
  11218. return;
  11219. if (!reset && this.list.length >= this.total && this.total !== 0)
  11220. return;
  11221. this.loading = true;
  11222. try {
  11223. const res = await pageBalanceOnApp({
  11224. pageNum: this.pageNum,
  11225. pageSize: this.pageSize
  11226. });
  11227. if (res.code === 200) {
  11228. this.total = res.total || 0;
  11229. const rows = res.rows || [];
  11230. const mappedRows = rows.map((item) => {
  11231. const isAdd = item.type === "add";
  11232. const uiType = isAdd ? "income" : "expense";
  11233. const title = bizTypeMap$3[item.bizType] || item.bizType || "其他";
  11234. let amountStr = (Math.abs(item.amount) / 100).toFixed(2);
  11235. if (!isAdd) {
  11236. amountStr = "-" + amountStr;
  11237. }
  11238. return {
  11239. ...item,
  11240. title,
  11241. desc: item.reason || "",
  11242. time: item.createTime || "",
  11243. amount: amountStr,
  11244. type: uiType,
  11245. // 'income' or 'expense' for template class
  11246. tag: title
  11247. };
  11248. });
  11249. this.list = this.list.concat(mappedRows);
  11250. this.pageNum++;
  11251. }
  11252. } catch (error) {
  11253. formatAppLog("error", "at pages/mine/wallet/index.vue:182", "获取列表数据失败", error);
  11254. } finally {
  11255. this.loading = false;
  11256. }
  11257. },
  11258. navBack() {
  11259. uni.navigateBack();
  11260. },
  11261. navToBill() {
  11262. uni.navigateTo({
  11263. url: "/pages/mine/wallet/bill"
  11264. });
  11265. },
  11266. switchTab(index) {
  11267. this.currentTab = index;
  11268. }
  11269. }
  11270. };
  11271. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  11272. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11273. vue.createElementVNode("view", { class: "nav-bar" }, [
  11274. vue.createElementVNode("view", {
  11275. class: "nav-left",
  11276. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  11277. }, [
  11278. vue.createElementVNode("image", {
  11279. class: "back-icon",
  11280. src: _imports_0
  11281. })
  11282. ]),
  11283. vue.createElementVNode("text", { class: "nav-title" }, "我的钱包"),
  11284. vue.createElementVNode("view", { class: "nav-right" })
  11285. ]),
  11286. vue.createElementVNode("view", { class: "wallet-card" }, [
  11287. vue.createElementVNode("view", { class: "bg-circle big" }),
  11288. vue.createElementVNode("view", { class: "bg-circle small" }),
  11289. vue.createElementVNode("view", { class: "card-content" }, [
  11290. vue.createElementVNode("view", { class: "card-top" }, [
  11291. vue.createElementVNode("view", { class: "app-info" }, [
  11292. vue.createElementVNode("image", {
  11293. class: "app-logo",
  11294. src: _imports_1$2,
  11295. mode: "aspectFit"
  11296. }),
  11297. vue.createElementVNode("text", { class: "app-name" }, "履约者APP")
  11298. ]),
  11299. vue.createElementVNode("view", {
  11300. class: "bill-btn",
  11301. onClick: _cache[1] || (_cache[1] = (...args) => $options.navToBill && $options.navToBill(...args))
  11302. }, [
  11303. vue.createElementVNode("text", null, "账单")
  11304. ])
  11305. ]),
  11306. vue.createElementVNode("view", { class: "balance-container" }, [
  11307. vue.createElementVNode("view", { class: "balance-main" }, [
  11308. vue.createElementVNode("text", { class: "balance-label" }, "账户余额 (元)"),
  11309. vue.createElementVNode(
  11310. "text",
  11311. { class: "balance-num" },
  11312. vue.toDisplayString($data.balance),
  11313. 1
  11314. /* TEXT */
  11315. )
  11316. ]),
  11317. vue.createElementVNode("view", { class: "balance-pending" }, [
  11318. vue.createElementVNode("text", { class: "pending-label" }, "待入账 (元)"),
  11319. vue.createElementVNode(
  11320. "text",
  11321. { class: "pending-num" },
  11322. vue.toDisplayString($data.pendingBalance),
  11323. 1
  11324. /* TEXT */
  11325. )
  11326. ])
  11327. ])
  11328. ])
  11329. ]),
  11330. vue.createElementVNode("view", { class: "record-container" }, [
  11331. vue.createElementVNode("view", { class: "record-header" }, [
  11332. vue.createElementVNode("text", { class: "header-title" }, "最近账户余额变动记录"),
  11333. vue.createElementVNode("view", {
  11334. class: "header-more",
  11335. onClick: _cache[2] || (_cache[2] = (...args) => $options.navToBill && $options.navToBill(...args))
  11336. }, [
  11337. vue.createElementVNode("text", null, "查看全部"),
  11338. vue.createElementVNode("image", {
  11339. class: "more-icon",
  11340. src: _imports_2$2
  11341. })
  11342. ])
  11343. ]),
  11344. vue.createElementVNode("view", { class: "tabs-row" }, [
  11345. vue.createElementVNode(
  11346. "view",
  11347. {
  11348. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 0 }]),
  11349. onClick: _cache[3] || (_cache[3] = ($event) => $options.switchTab(0))
  11350. },
  11351. [
  11352. vue.createElementVNode("text", null, "全部"),
  11353. $data.currentTab === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  11354. key: 0,
  11355. class: "tab-line"
  11356. })) : vue.createCommentVNode("v-if", true)
  11357. ],
  11358. 2
  11359. /* CLASS */
  11360. ),
  11361. vue.createElementVNode(
  11362. "view",
  11363. {
  11364. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 1 }]),
  11365. onClick: _cache[4] || (_cache[4] = ($event) => $options.switchTab(1))
  11366. },
  11367. [
  11368. vue.createElementVNode("text", null, "收入"),
  11369. $data.currentTab === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  11370. key: 0,
  11371. class: "tab-line"
  11372. })) : vue.createCommentVNode("v-if", true)
  11373. ],
  11374. 2
  11375. /* CLASS */
  11376. ),
  11377. vue.createElementVNode(
  11378. "view",
  11379. {
  11380. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 2 }]),
  11381. onClick: _cache[5] || (_cache[5] = ($event) => $options.switchTab(2))
  11382. },
  11383. [
  11384. vue.createElementVNode("text", null, "支出"),
  11385. $data.currentTab === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  11386. key: 0,
  11387. class: "tab-line"
  11388. })) : vue.createCommentVNode("v-if", true)
  11389. ],
  11390. 2
  11391. /* CLASS */
  11392. )
  11393. ]),
  11394. vue.createElementVNode("view", { class: "record-list" }, [
  11395. (vue.openBlock(true), vue.createElementBlock(
  11396. vue.Fragment,
  11397. null,
  11398. vue.renderList($options.displayList, (item, index) => {
  11399. return vue.openBlock(), vue.createElementBlock("view", {
  11400. class: "list-item",
  11401. key: index
  11402. }, [
  11403. vue.createElementVNode("view", { class: "item-left" }, [
  11404. vue.createElementVNode(
  11405. "text",
  11406. { class: "item-title" },
  11407. vue.toDisplayString(item.title),
  11408. 1
  11409. /* TEXT */
  11410. ),
  11411. vue.createElementVNode(
  11412. "text",
  11413. { class: "item-desc" },
  11414. vue.toDisplayString(item.desc),
  11415. 1
  11416. /* TEXT */
  11417. ),
  11418. vue.createElementVNode(
  11419. "text",
  11420. { class: "item-time" },
  11421. vue.toDisplayString(item.time),
  11422. 1
  11423. /* TEXT */
  11424. )
  11425. ]),
  11426. vue.createElementVNode("view", { class: "item-right" }, [
  11427. vue.createElementVNode(
  11428. "text",
  11429. {
  11430. class: vue.normalizeClass(["item-amount", { income: item.type === "income", expense: item.type === "expense" }])
  11431. },
  11432. vue.toDisplayString(item.type === "income" ? "+" : "") + vue.toDisplayString(item.amount),
  11433. 3
  11434. /* TEXT, CLASS */
  11435. ),
  11436. vue.createElementVNode("view", { class: "item-tag" }, [
  11437. vue.createElementVNode(
  11438. "text",
  11439. null,
  11440. vue.toDisplayString(item.tag),
  11441. 1
  11442. /* TEXT */
  11443. )
  11444. ])
  11445. ])
  11446. ]);
  11447. }),
  11448. 128
  11449. /* KEYED_FRAGMENT */
  11450. ))
  11451. ])
  11452. ])
  11453. ]);
  11454. }
  11455. const PagesMineWalletIndex = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/wallet/index.vue"]]);
  11456. const bizTypeMap$2 = fulfillerEnum.FlfBalanceBizType;
  11457. const _sfc_main$9 = {
  11458. data() {
  11459. const d = /* @__PURE__ */ new Date();
  11460. return {
  11461. currentTab: 0,
  11462. year: d.getFullYear(),
  11463. month: d.getMonth() + 1,
  11464. groups: []
  11465. };
  11466. },
  11467. computed: {
  11468. currentDate() {
  11469. return `${this.year}-${String(this.month).padStart(2, "0")}`;
  11470. },
  11471. displayGroups() {
  11472. if (this.currentTab === 0)
  11473. return this.groups;
  11474. return this.groups.map((group) => {
  11475. const filteredItems = group.items.filter((item) => {
  11476. const type = this.currentTab === 1 ? "income" : "expense";
  11477. return item.type === type;
  11478. });
  11479. return {
  11480. ...group,
  11481. items: filteredItems
  11482. };
  11483. }).filter((group) => group.items.length > 0);
  11484. }
  11485. },
  11486. onShow() {
  11487. this.fetchData();
  11488. },
  11489. methods: {
  11490. async fetchData() {
  11491. try {
  11492. const res = await listBalanceOnApp({
  11493. year: this.year,
  11494. month: this.month
  11495. });
  11496. if (res.code === 200) {
  11497. const list = res.data || [];
  11498. let incomeTotal = 0;
  11499. let expenseTotal = 0;
  11500. const items = list.map((item) => {
  11501. const isAdd = item.type === "add";
  11502. const uiType = isAdd ? "income" : "expense";
  11503. const title = bizTypeMap$2[item.bizType] || item.bizType || "其他";
  11504. let amountVal = Math.abs(item.amount) / 100;
  11505. if (isAdd) {
  11506. incomeTotal += amountVal;
  11507. } else {
  11508. expenseTotal += amountVal;
  11509. }
  11510. let amountStr = amountVal.toFixed(2);
  11511. if (!isAdd)
  11512. amountStr = "-" + amountStr;
  11513. let timeStr = item.createTime || "";
  11514. if (timeStr.length >= 16) {
  11515. timeStr = timeStr.substring(5, 16);
  11516. }
  11517. return {
  11518. ...item,
  11519. title,
  11520. desc: item.reason || "",
  11521. time: timeStr,
  11522. amount: amountStr,
  11523. type: uiType,
  11524. tag: title
  11525. };
  11526. });
  11527. this.groups = [
  11528. {
  11529. month: `${this.month}月 ${this.year}`,
  11530. income: incomeTotal.toFixed(2),
  11531. expense: expenseTotal.toFixed(2),
  11532. items
  11533. }
  11534. ];
  11535. }
  11536. } catch (error) {
  11537. formatAppLog("error", "at pages/mine/wallet/bill.vue:175", "获取账单记录失败", error);
  11538. }
  11539. },
  11540. onDateChange(e) {
  11541. const val = e.detail.value;
  11542. const [y, m] = val.split("-");
  11543. this.year = parseInt(y, 10);
  11544. this.month = parseInt(m, 10);
  11545. this.fetchData();
  11546. },
  11547. navBack() {
  11548. uni.navigateBack();
  11549. },
  11550. switchTab(index) {
  11551. this.currentTab = index;
  11552. }
  11553. }
  11554. };
  11555. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  11556. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11557. vue.createElementVNode("view", { class: "nav-bar" }, [
  11558. vue.createElementVNode("view", {
  11559. class: "nav-left",
  11560. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  11561. }, [
  11562. vue.createElementVNode("image", {
  11563. class: "back-icon",
  11564. src: _imports_0
  11565. })
  11566. ]),
  11567. vue.createElementVNode("text", { class: "nav-title" }, "账单明细"),
  11568. vue.createElementVNode("view", { class: "nav-right" })
  11569. ]),
  11570. vue.createElementVNode("view", { class: "content-area" }, [
  11571. vue.createElementVNode("view", { class: "filter-area" }, [
  11572. vue.createElementVNode("view", { class: "tabs-row" }, [
  11573. vue.createElementVNode(
  11574. "view",
  11575. {
  11576. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 0 }]),
  11577. onClick: _cache[1] || (_cache[1] = ($event) => $options.switchTab(0))
  11578. },
  11579. [
  11580. vue.createElementVNode("text", null, "全部"),
  11581. $data.currentTab === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  11582. key: 0,
  11583. class: "tab-line"
  11584. })) : vue.createCommentVNode("v-if", true)
  11585. ],
  11586. 2
  11587. /* CLASS */
  11588. ),
  11589. vue.createElementVNode(
  11590. "view",
  11591. {
  11592. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 1 }]),
  11593. onClick: _cache[2] || (_cache[2] = ($event) => $options.switchTab(1))
  11594. },
  11595. [
  11596. vue.createElementVNode("text", null, "收入"),
  11597. $data.currentTab === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  11598. key: 0,
  11599. class: "tab-line"
  11600. })) : vue.createCommentVNode("v-if", true)
  11601. ],
  11602. 2
  11603. /* CLASS */
  11604. ),
  11605. vue.createElementVNode(
  11606. "view",
  11607. {
  11608. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 2 }]),
  11609. onClick: _cache[3] || (_cache[3] = ($event) => $options.switchTab(2))
  11610. },
  11611. [
  11612. vue.createElementVNode("text", null, "支出"),
  11613. $data.currentTab === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  11614. key: 0,
  11615. class: "tab-line"
  11616. })) : vue.createCommentVNode("v-if", true)
  11617. ],
  11618. 2
  11619. /* CLASS */
  11620. )
  11621. ]),
  11622. vue.createElementVNode("view", { class: "date-picker-wrap" }, [
  11623. vue.createElementVNode("picker", {
  11624. mode: "date",
  11625. fields: "month",
  11626. value: $options.currentDate,
  11627. onChange: _cache[4] || (_cache[4] = (...args) => $options.onDateChange && $options.onDateChange(...args))
  11628. }, [
  11629. vue.createElementVNode("view", { class: "date-picker" }, [
  11630. vue.createElementVNode(
  11631. "text",
  11632. { class: "date-text" },
  11633. vue.toDisplayString($data.year) + "年" + vue.toDisplayString(`${$data.month}`.padStart(2, "0")) + "月",
  11634. 1
  11635. /* TEXT */
  11636. ),
  11637. vue.createElementVNode("text", { class: "arrow-down" }, "﹀")
  11638. ])
  11639. ], 40, ["value"])
  11640. ])
  11641. ]),
  11642. vue.createElementVNode("scroll-view", {
  11643. "scroll-y": "",
  11644. class: "bill-list"
  11645. }, [
  11646. (vue.openBlock(true), vue.createElementBlock(
  11647. vue.Fragment,
  11648. null,
  11649. vue.renderList($options.displayGroups, (group, gIndex) => {
  11650. return vue.openBlock(), vue.createElementBlock("view", {
  11651. key: gIndex,
  11652. class: "month-group"
  11653. }, [
  11654. vue.createElementVNode("view", { class: "group-header" }, [
  11655. vue.createElementVNode(
  11656. "text",
  11657. { class: "month-title" },
  11658. vue.toDisplayString(group.month),
  11659. 1
  11660. /* TEXT */
  11661. ),
  11662. vue.createElementVNode(
  11663. "text",
  11664. { class: "month-summary" },
  11665. "收入 ¥" + vue.toDisplayString(group.income) + " 支出 ¥" + vue.toDisplayString(group.expense),
  11666. 1
  11667. /* TEXT */
  11668. )
  11669. ]),
  11670. (vue.openBlock(true), vue.createElementBlock(
  11671. vue.Fragment,
  11672. null,
  11673. vue.renderList(group.items, (item, index) => {
  11674. return vue.openBlock(), vue.createElementBlock("view", {
  11675. class: "list-item",
  11676. key: index
  11677. }, [
  11678. vue.createElementVNode(
  11679. "view",
  11680. {
  11681. class: vue.normalizeClass(["item-icon-box", item.type])
  11682. },
  11683. [
  11684. vue.createElementVNode(
  11685. "text",
  11686. { class: "item-icon-symbol" },
  11687. vue.toDisplayString(item.type === "income" ? "+" : "-"),
  11688. 1
  11689. /* TEXT */
  11690. )
  11691. ],
  11692. 2
  11693. /* CLASS */
  11694. ),
  11695. vue.createElementVNode("view", { class: "item-center" }, [
  11696. vue.createElementVNode(
  11697. "text",
  11698. { class: "item-title" },
  11699. vue.toDisplayString(item.title),
  11700. 1
  11701. /* TEXT */
  11702. ),
  11703. vue.createElementVNode(
  11704. "text",
  11705. { class: "item-desc" },
  11706. vue.toDisplayString(item.time) + " " + vue.toDisplayString(item.desc),
  11707. 1
  11708. /* TEXT */
  11709. )
  11710. ]),
  11711. vue.createElementVNode("view", { class: "item-right" }, [
  11712. vue.createElementVNode(
  11713. "text",
  11714. {
  11715. class: vue.normalizeClass(["item-amount", { income: item.type === "income", expense: item.type === "expense" }])
  11716. },
  11717. vue.toDisplayString(item.type === "income" ? "+" : "") + vue.toDisplayString(item.amount),
  11718. 3
  11719. /* TEXT, CLASS */
  11720. ),
  11721. vue.createElementVNode("view", { class: "item-tag" }, [
  11722. vue.createElementVNode(
  11723. "text",
  11724. null,
  11725. vue.toDisplayString(item.tag),
  11726. 1
  11727. /* TEXT */
  11728. )
  11729. ])
  11730. ])
  11731. ]);
  11732. }),
  11733. 128
  11734. /* KEYED_FRAGMENT */
  11735. ))
  11736. ]);
  11737. }),
  11738. 128
  11739. /* KEYED_FRAGMENT */
  11740. )),
  11741. vue.createElementVNode("view", { class: "list-padding-bottom" })
  11742. ])
  11743. ])
  11744. ]);
  11745. }
  11746. const PagesMineWalletBill = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/wallet/bill.vue"]]);
  11747. function listAllLevelRights() {
  11748. return request({
  11749. url: "/fulfiller/levelRights/listAll",
  11750. method: "GET"
  11751. });
  11752. }
  11753. const _sfc_main$8 = {
  11754. data() {
  11755. return {
  11756. currentIndex: 0,
  11757. profile: null,
  11758. levels: [],
  11759. // 从后端获取的等级配置
  11760. rightsList: [],
  11761. // 从后端获取的所有权益列表
  11762. isPopupShow: false,
  11763. currentBenefit: null,
  11764. pageLoading: true
  11765. };
  11766. },
  11767. computed: {
  11768. currentLevel() {
  11769. return this.processedLevels[this.currentIndex];
  11770. },
  11771. // 合并等级与对应的权益详细信息
  11772. processedLevels() {
  11773. if (!this.levels.length)
  11774. return [];
  11775. return this.levels.map((lvl) => {
  11776. const benefits = (lvl.rights || []).map((rightId) => {
  11777. return this.rightsList.find((r) => r.id === rightId);
  11778. }).filter(Boolean);
  11779. return {
  11780. ...lvl,
  11781. isCurrent: this.profile && this.profile.level === lvl.lvNo,
  11782. benefits
  11783. };
  11784. }).sort((a, b) => a.lvNo - b.lvNo);
  11785. }
  11786. },
  11787. async onLoad() {
  11788. await this.initData();
  11789. },
  11790. methods: {
  11791. async initData() {
  11792. this.pageLoading = true;
  11793. uni.showLoading({ title: "加载中..." });
  11794. try {
  11795. const [profileRes, levelsRes, rightsRes] = await Promise.all([
  11796. getMyProfile(),
  11797. listAllLevelConfigs(),
  11798. listAllLevelRights()
  11799. ]);
  11800. this.profile = profileRes.data;
  11801. this.levels = levelsRes.data || [];
  11802. this.rightsList = rightsRes.data || [];
  11803. if (this.profile) {
  11804. const idx = this.processedLevels.findIndex((lvl) => lvl.lvNo === this.profile.level);
  11805. if (idx !== -1) {
  11806. this.currentIndex = idx;
  11807. }
  11808. }
  11809. } catch (err) {
  11810. formatAppLog("error", "at pages/mine/level/index.vue:157", "初始化等级页面失败:", err);
  11811. uni.showToast({ title: "数据加载失败", icon: "none" });
  11812. } finally {
  11813. this.pageLoading = false;
  11814. uni.hideLoading();
  11815. }
  11816. },
  11817. navBack() {
  11818. uni.navigateBack();
  11819. },
  11820. swiperChange(e) {
  11821. this.currentIndex = e.detail.current;
  11822. },
  11823. changeLevel(index) {
  11824. this.currentIndex = index;
  11825. },
  11826. showBenefitDetail(benefit) {
  11827. this.currentBenefit = benefit;
  11828. this.isPopupShow = true;
  11829. },
  11830. closePopup() {
  11831. this.isPopupShow = false;
  11832. }
  11833. }
  11834. };
  11835. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  11836. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11837. vue.createElementVNode("view", { class: "custom-header" }, [
  11838. vue.createElementVNode("view", {
  11839. class: "header-left",
  11840. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  11841. }, [
  11842. vue.createElementVNode("image", {
  11843. class: "back-icon",
  11844. src: _imports_0,
  11845. style: { "transform": "rotate(180deg)" }
  11846. })
  11847. ]),
  11848. vue.createElementVNode("text", { class: "header-title" }, "履约者等级权益"),
  11849. vue.createElementVNode("view", { class: "header-right" })
  11850. ]),
  11851. vue.createElementVNode("view", { class: "header-placeholder" }),
  11852. !$data.pageLoading ? (vue.openBlock(), vue.createElementBlock("view", {
  11853. key: 0,
  11854. class: "swiper-container"
  11855. }, [
  11856. vue.createElementVNode("swiper", {
  11857. class: "level-swiper",
  11858. "previous-margin": "80rpx",
  11859. "next-margin": "80rpx",
  11860. current: $data.currentIndex,
  11861. onChange: _cache[1] || (_cache[1] = (...args) => $options.swiperChange && $options.swiperChange(...args))
  11862. }, [
  11863. (vue.openBlock(true), vue.createElementBlock(
  11864. vue.Fragment,
  11865. null,
  11866. vue.renderList($options.processedLevels, (level, index) => {
  11867. return vue.openBlock(), vue.createElementBlock("swiper-item", {
  11868. key: index,
  11869. onClick: ($event) => $options.changeLevel(index)
  11870. }, [
  11871. vue.createElementVNode(
  11872. "view",
  11873. {
  11874. class: "level-card",
  11875. style: vue.normalizeStyle({
  11876. transform: $data.currentIndex === index ? "scale(1)" : "scale(0.9)",
  11877. backgroundImage: "url(" + level.backgroundUrl + ")",
  11878. backgroundSize: "cover",
  11879. backgroundPosition: "center"
  11880. })
  11881. },
  11882. [
  11883. vue.createElementVNode("view", { class: "card-content" }, [
  11884. vue.createElementVNode("view", { class: "card-header" }, [
  11885. vue.createElementVNode(
  11886. "view",
  11887. { class: "level-badge" },
  11888. "L" + vue.toDisplayString(index + 1),
  11889. 1
  11890. /* TEXT */
  11891. ),
  11892. level.isCurrent ? (vue.openBlock(), vue.createElementBlock("view", {
  11893. key: 0,
  11894. class: "current-badge"
  11895. }, "当前等级")) : vue.createCommentVNode("v-if", true)
  11896. ]),
  11897. vue.createElementVNode(
  11898. "text",
  11899. { class: "level-name" },
  11900. vue.toDisplayString(level.name),
  11901. 1
  11902. /* TEXT */
  11903. ),
  11904. vue.createElementVNode(
  11905. "text",
  11906. { class: "level-score" },
  11907. "所需积分: " + vue.toDisplayString(level.upgradePoints || 0),
  11908. 1
  11909. /* TEXT */
  11910. ),
  11911. vue.createElementVNode("image", {
  11912. class: "crown-overlay",
  11913. src: _imports_1$5,
  11914. mode: "aspectFit"
  11915. })
  11916. ])
  11917. ],
  11918. 4
  11919. /* STYLE */
  11920. )
  11921. ], 8, ["onClick"]);
  11922. }),
  11923. 128
  11924. /* KEYED_FRAGMENT */
  11925. ))
  11926. ], 40, ["current"]),
  11927. vue.createElementVNode("view", { class: "swiper-dots" }, [
  11928. (vue.openBlock(true), vue.createElementBlock(
  11929. vue.Fragment,
  11930. null,
  11931. vue.renderList($options.processedLevels, (item, index) => {
  11932. return vue.openBlock(), vue.createElementBlock(
  11933. "view",
  11934. {
  11935. class: vue.normalizeClass(["dot", { active: $data.currentIndex === index }]),
  11936. key: index
  11937. },
  11938. null,
  11939. 2
  11940. /* CLASS */
  11941. );
  11942. }),
  11943. 128
  11944. /* KEYED_FRAGMENT */
  11945. ))
  11946. ])
  11947. ])) : vue.createCommentVNode("v-if", true),
  11948. !$data.pageLoading && $options.currentLevel ? (vue.openBlock(), vue.createElementBlock("view", {
  11949. key: 1,
  11950. class: "benefits-title-row"
  11951. }, [
  11952. vue.createElementVNode("text", { class: "benefits-title" }, "专属权益"),
  11953. vue.createElementVNode(
  11954. "text",
  11955. { class: "benefits-count" },
  11956. "(" + vue.toDisplayString($options.currentLevel.benefits ? $options.currentLevel.benefits.length : 0) + ")",
  11957. 1
  11958. /* TEXT */
  11959. )
  11960. ])) : vue.createCommentVNode("v-if", true),
  11961. !$data.pageLoading && $options.currentLevel ? (vue.openBlock(), vue.createElementBlock("view", {
  11962. key: 2,
  11963. class: "benefits-grid"
  11964. }, [
  11965. (vue.openBlock(true), vue.createElementBlock(
  11966. vue.Fragment,
  11967. null,
  11968. vue.renderList($options.currentLevel.benefits, (benefit, index) => {
  11969. return vue.openBlock(), vue.createElementBlock("view", {
  11970. class: "benefit-item",
  11971. key: index,
  11972. onClick: ($event) => $options.showBenefitDetail(benefit)
  11973. }, [
  11974. vue.createElementVNode("view", { class: "benefit-icon-wrapper" }, [
  11975. benefit.iconUrl ? (vue.openBlock(), vue.createElementBlock("image", {
  11976. key: 0,
  11977. class: "benefit-icon",
  11978. src: benefit.iconUrl,
  11979. mode: "aspectFit"
  11980. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock(
  11981. "view",
  11982. {
  11983. key: 1,
  11984. class: "benefit-icon-placeholder"
  11985. },
  11986. vue.toDisplayString(benefit.name[0]),
  11987. 1
  11988. /* TEXT */
  11989. ))
  11990. ]),
  11991. vue.createElementVNode(
  11992. "text",
  11993. { class: "benefit-name" },
  11994. vue.toDisplayString(benefit.name),
  11995. 1
  11996. /* TEXT */
  11997. )
  11998. ], 8, ["onClick"]);
  11999. }),
  12000. 128
  12001. /* KEYED_FRAGMENT */
  12002. )),
  12003. !$options.currentLevel.benefits || $options.currentLevel.benefits.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  12004. key: 0,
  12005. class: "empty-benefits"
  12006. }, [
  12007. vue.createElementVNode("text", null, "该等级暂无特殊权益")
  12008. ])) : vue.createCommentVNode("v-if", true)
  12009. ])) : vue.createCommentVNode("v-if", true),
  12010. vue.createElementVNode(
  12011. "view",
  12012. {
  12013. class: vue.normalizeClass(["popup-mask", { "show": $data.isPopupShow }]),
  12014. onClick: _cache[4] || (_cache[4] = (...args) => $options.closePopup && $options.closePopup(...args)),
  12015. onTouchmove: _cache[5] || (_cache[5] = vue.withModifiers(() => {
  12016. }, ["stop", "prevent"]))
  12017. },
  12018. [
  12019. vue.createElementVNode("view", {
  12020. class: "popup-modal",
  12021. onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
  12022. }, ["stop"]))
  12023. }, [
  12024. vue.createElementVNode("view", { class: "popup-icon-wrapper" }, [
  12025. $data.currentBenefit && $data.currentBenefit.iconUrl ? (vue.openBlock(), vue.createElementBlock("image", {
  12026. key: 0,
  12027. class: "benefit-icon-large",
  12028. src: $data.currentBenefit.iconUrl,
  12029. mode: "aspectFit"
  12030. }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock(
  12031. "view",
  12032. {
  12033. key: 1,
  12034. class: "benefit-icon-placeholder-large"
  12035. },
  12036. vue.toDisplayString($data.currentBenefit ? $data.currentBenefit.name[0] : ""),
  12037. 1
  12038. /* TEXT */
  12039. ))
  12040. ]),
  12041. vue.createElementVNode(
  12042. "text",
  12043. { class: "popup-title" },
  12044. vue.toDisplayString($data.currentBenefit ? $data.currentBenefit.name : ""),
  12045. 1
  12046. /* TEXT */
  12047. ),
  12048. vue.createElementVNode(
  12049. "text",
  12050. { class: "popup-desc" },
  12051. vue.toDisplayString($data.currentBenefit ? $data.currentBenefit.statement : ""),
  12052. 1
  12053. /* TEXT */
  12054. ),
  12055. vue.createElementVNode("button", {
  12056. class: "popup-btn",
  12057. onClick: _cache[2] || (_cache[2] = (...args) => $options.closePopup && $options.closePopup(...args))
  12058. }, "我知道了")
  12059. ])
  12060. ],
  12061. 34
  12062. /* CLASS, NEED_HYDRATION */
  12063. )
  12064. ]);
  12065. }
  12066. const PagesMineLevelIndex = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/level/index.vue"]]);
  12067. const _imports_1$1 = "/static/icons/icon_order_msg.svg";
  12068. const _imports_2$1 = "/static/icons/icon_system_msg.svg";
  12069. const _sfc_main$7 = {
  12070. data() {
  12071. return {};
  12072. },
  12073. methods: {
  12074. navBack() {
  12075. uni.navigateBack();
  12076. },
  12077. navToOrderMsg() {
  12078. uni.navigateTo({
  12079. url: "/pages/mine/message/order"
  12080. });
  12081. },
  12082. navToSystemMsg() {
  12083. uni.navigateTo({
  12084. url: "/pages/mine/message/system"
  12085. });
  12086. }
  12087. }
  12088. };
  12089. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  12090. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12091. vue.createElementVNode("view", { class: "nav-bar" }, [
  12092. vue.createElementVNode("view", {
  12093. class: "nav-left",
  12094. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12095. }, [
  12096. vue.createElementVNode("image", {
  12097. class: "back-icon",
  12098. src: _imports_0,
  12099. style: { "transform": "rotate(180deg)" }
  12100. })
  12101. ]),
  12102. vue.createElementVNode("text", { class: "nav-title" }, "消息中心"),
  12103. vue.createElementVNode("view", { class: "nav-right" }, [
  12104. vue.createElementVNode("view", { class: "more-dots" }, [
  12105. vue.createElementVNode("view", { class: "dot" }),
  12106. vue.createElementVNode("view", { class: "dot" }),
  12107. vue.createElementVNode("view", { class: "dot" })
  12108. ])
  12109. ])
  12110. ]),
  12111. vue.createElementVNode("view", { class: "nav-placeholder" }),
  12112. vue.createElementVNode("view", { class: "message-list" }, [
  12113. vue.createElementVNode("view", {
  12114. class: "message-item",
  12115. onClick: _cache[1] || (_cache[1] = (...args) => $options.navToOrderMsg && $options.navToOrderMsg(...args))
  12116. }, [
  12117. vue.createElementVNode("view", { class: "icon-wrapper" }, [
  12118. vue.createElementVNode("image", {
  12119. class: "msg-icon",
  12120. src: _imports_1$1
  12121. }),
  12122. vue.createElementVNode("view", { class: "red-dot-badge" })
  12123. ]),
  12124. vue.createElementVNode("view", { class: "content-wrapper" }, [
  12125. vue.createElementVNode("view", { class: "top-row" }, [
  12126. vue.createElementVNode("text", { class: "msg-title" }, "订单消息"),
  12127. vue.createElementVNode("text", { class: "msg-time" }, "5分钟前")
  12128. ]),
  12129. vue.createElementVNode("text", { class: "msg-preview" }, "你收到一个站长手动派单的新订单")
  12130. ])
  12131. ]),
  12132. vue.createElementVNode("view", {
  12133. class: "message-item",
  12134. onClick: _cache[2] || (_cache[2] = (...args) => $options.navToSystemMsg && $options.navToSystemMsg(...args))
  12135. }, [
  12136. vue.createElementVNode("view", { class: "icon-wrapper" }, [
  12137. vue.createElementVNode("image", {
  12138. class: "msg-icon",
  12139. src: _imports_2$1
  12140. })
  12141. ]),
  12142. vue.createElementVNode("view", { class: "content-wrapper" }, [
  12143. vue.createElementVNode("view", { class: "top-row" }, [
  12144. vue.createElementVNode("text", { class: "msg-title" }, "系统消息"),
  12145. vue.createElementVNode("text", { class: "msg-time" }, "7天前")
  12146. ]),
  12147. vue.createElementVNode("text", { class: "msg-preview" }, "你的健康证明认证审核已通过。")
  12148. ])
  12149. ])
  12150. ])
  12151. ]);
  12152. }
  12153. const PagesMineMessageIndex = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/message/index.vue"]]);
  12154. const _sfc_main$6 = {
  12155. methods: {
  12156. navBack() {
  12157. uni.navigateBack();
  12158. }
  12159. }
  12160. };
  12161. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  12162. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12163. vue.createElementVNode("view", { class: "nav-bar" }, [
  12164. vue.createElementVNode("view", {
  12165. class: "nav-left",
  12166. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12167. }, [
  12168. vue.createElementVNode("image", {
  12169. class: "back-icon",
  12170. src: _imports_0,
  12171. style: { "transform": "rotate(180deg)" }
  12172. })
  12173. ]),
  12174. vue.createElementVNode("text", { class: "nav-title" }, "订单消息"),
  12175. vue.createElementVNode("view", { class: "nav-right" })
  12176. ]),
  12177. vue.createElementVNode("view", { class: "nav-placeholder" }),
  12178. vue.createElementVNode("view", { class: "msg-group" }, [
  12179. vue.createElementVNode("view", { class: "date-label" }, "2099-12-28"),
  12180. vue.createElementVNode("view", { class: "msg-card" }, [
  12181. vue.createElementVNode("view", { class: "card-header" }, [
  12182. vue.createElementVNode("text", { class: "card-title" }, "站长手动派单"),
  12183. vue.createElementVNode("view", { class: "red-dot" })
  12184. ]),
  12185. vue.createElementVNode("view", { class: "card-body" }, [
  12186. vue.createElementVNode("text", { class: "msg-text" }, "你收到一个新订单,请及时查看并接单。")
  12187. ]),
  12188. vue.createElementVNode("view", { class: "card-footer" }, [
  12189. vue.createElementVNode("text", { class: "order-id" }, "订单: 2099091503521"),
  12190. vue.createElementVNode("image", {
  12191. class: "arrow-icon",
  12192. src: _imports_3
  12193. })
  12194. ])
  12195. ]),
  12196. vue.createElementVNode("view", { class: "msg-card" }, [
  12197. vue.createElementVNode("view", { class: "card-header" }, [
  12198. vue.createElementVNode("text", { class: "card-title" }, "系统自动派单")
  12199. ]),
  12200. vue.createElementVNode("view", { class: "card-body" }, [
  12201. vue.createElementVNode("text", { class: "msg-text" }, "你收到一个新订单,请及时查看并接单。")
  12202. ]),
  12203. vue.createElementVNode("view", { class: "card-footer" }, [
  12204. vue.createElementVNode("text", { class: "order-id" }, "订单: 2099091503523"),
  12205. vue.createElementVNode("image", {
  12206. class: "arrow-icon",
  12207. src: _imports_3
  12208. })
  12209. ])
  12210. ])
  12211. ]),
  12212. vue.createElementVNode("view", { class: "msg-group" }, [
  12213. vue.createElementVNode("view", { class: "date-label" }, "2099-12-27"),
  12214. vue.createElementVNode("view", { class: "msg-card" }, [
  12215. vue.createElementVNode("view", { class: "card-header" }, [
  12216. vue.createElementVNode("text", { class: "card-title" }, "系统取消派单")
  12217. ]),
  12218. vue.createElementVNode("view", { class: "card-body" }, [
  12219. vue.createElementVNode("text", { class: "msg-text" }, "订单由于超时未接单已被系统取消。")
  12220. ]),
  12221. vue.createElementVNode("view", { class: "card-footer" }, [
  12222. vue.createElementVNode("text", { class: "order-id" }, "订单: 2099091503111"),
  12223. vue.createElementVNode("image", {
  12224. class: "arrow-icon",
  12225. src: _imports_3
  12226. })
  12227. ])
  12228. ])
  12229. ])
  12230. ]);
  12231. }
  12232. const PagesMineMessageOrder = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/message/order.vue"]]);
  12233. const _sfc_main$5 = {
  12234. methods: {
  12235. navBack() {
  12236. uni.navigateBack();
  12237. },
  12238. navToDetail() {
  12239. uni.navigateTo({
  12240. url: "/pages/mine/message/detail"
  12241. });
  12242. }
  12243. }
  12244. };
  12245. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  12246. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12247. vue.createElementVNode("view", { class: "nav-bar" }, [
  12248. vue.createElementVNode("view", {
  12249. class: "nav-left",
  12250. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12251. }, [
  12252. vue.createElementVNode("image", {
  12253. class: "back-icon",
  12254. src: _imports_0,
  12255. style: { "transform": "rotate(180deg)" }
  12256. })
  12257. ]),
  12258. vue.createElementVNode("text", { class: "nav-title" }, "系统消息"),
  12259. vue.createElementVNode("view", { class: "nav-right" })
  12260. ]),
  12261. vue.createElementVNode("view", { class: "nav-placeholder" }),
  12262. vue.createElementVNode("view", { class: "sys-msg-list" }, [
  12263. vue.createElementVNode("view", { class: "date-label" }, "2023-11-01"),
  12264. vue.createElementVNode("view", {
  12265. class: "sys-card",
  12266. onClick: _cache[1] || (_cache[1] = (...args) => $options.navToDetail && $options.navToDetail(...args))
  12267. }, [
  12268. vue.createElementVNode("view", { class: "sys-header" }, [
  12269. vue.createElementVNode("text", { class: "sys-title" }, "账号审核通过"),
  12270. vue.createElementVNode("view", { class: "red-dot" })
  12271. ]),
  12272. vue.createElementVNode("view", { class: "sys-content" }, [
  12273. vue.createElementVNode("text", { class: "sys-text" }, "恭喜,您的健康证已通过审核,现在可以开始接单了。")
  12274. ]),
  12275. vue.createElementVNode("view", { class: "sys-footer" }, [
  12276. vue.createElementVNode("text", { class: "sys-time" }, "10:00"),
  12277. vue.createElementVNode("view", { class: "check-more" }, [
  12278. vue.createElementVNode("text", null, "查看详情"),
  12279. vue.createElementVNode("image", {
  12280. class: "arrow-icon-small",
  12281. src: _imports_3
  12282. })
  12283. ])
  12284. ])
  12285. ]),
  12286. vue.createElementVNode("view", { class: "sys-card" }, [
  12287. vue.createElementVNode("view", { class: "sys-header" }, [
  12288. vue.createElementVNode("text", { class: "sys-title" }, "活动奖励到账")
  12289. ]),
  12290. vue.createElementVNode("view", { class: "sys-content" }, [
  12291. vue.createElementVNode("text", { class: "sys-text" }, "您参与的“新手启航”活动奖励金 ¥50 已发放到您的账户。")
  12292. ]),
  12293. vue.createElementVNode("view", { class: "sys-footer" }, [
  12294. vue.createElementVNode("text", { class: "sys-time" }, "09:15"),
  12295. vue.createElementVNode("view", { class: "check-more" }, [
  12296. vue.createElementVNode("text", null, "查看详情"),
  12297. vue.createElementVNode("image", {
  12298. class: "arrow-icon-small",
  12299. src: _imports_3
  12300. })
  12301. ])
  12302. ])
  12303. ]),
  12304. vue.createElementVNode("view", { class: "date-label" }, "2023-10-30"),
  12305. vue.createElementVNode("view", { class: "sys-card" }, [
  12306. vue.createElementVNode("view", { class: "sys-header" }, [
  12307. vue.createElementVNode("text", { class: "sys-title" }, "系统维护通知")
  12308. ]),
  12309. vue.createElementVNode("view", { class: "sys-content" }, [
  12310. vue.createElementVNode("text", { class: "sys-text" }, "平台将于 11月5日 凌晨 02:00-04:00 进行系统维护,届时将无法接单。")
  12311. ]),
  12312. vue.createElementVNode("view", { class: "sys-footer" }, [
  12313. vue.createElementVNode("text", { class: "sys-time" }, "18:30"),
  12314. vue.createElementVNode("view", { class: "check-more" }, [
  12315. vue.createElementVNode("text", null, "查看详情"),
  12316. vue.createElementVNode("image", {
  12317. class: "arrow-icon-small",
  12318. src: _imports_3
  12319. })
  12320. ])
  12321. ])
  12322. ])
  12323. ])
  12324. ]);
  12325. }
  12326. const PagesMineMessageSystem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/message/system.vue"]]);
  12327. const _sfc_main$4 = {
  12328. methods: {
  12329. navBack() {
  12330. uni.navigateBack();
  12331. }
  12332. }
  12333. };
  12334. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  12335. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12336. vue.createElementVNode("view", { class: "nav-bar" }, [
  12337. vue.createElementVNode("view", {
  12338. class: "nav-left",
  12339. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12340. }, [
  12341. vue.createElementVNode("image", {
  12342. class: "back-icon",
  12343. src: _imports_0,
  12344. style: { "transform": "rotate(180deg)" }
  12345. })
  12346. ]),
  12347. vue.createElementVNode("text", { class: "nav-title" }, "消息详情"),
  12348. vue.createElementVNode("view", { class: "nav-right" })
  12349. ]),
  12350. vue.createElementVNode("view", { class: "nav-placeholder" }),
  12351. vue.createElementVNode("view", { class: "detail-content" }, [
  12352. vue.createElementVNode("text", { class: "detail-title" }, "账号审核通过"),
  12353. vue.createElementVNode("text", { class: "detail-time" }, "2023-11-01 10:00"),
  12354. vue.createElementVNode("view", { class: "detail-body" }, [
  12355. vue.createElementVNode("text", null, "尊敬的用户,您的健康认证资料已通过平台审核。作为履约者,您现在可以正常接收并处理订单。请确保您熟读平台规则,遵守交通法规,安全配送。祝您工作愉快!")
  12356. ]),
  12357. vue.createElementVNode("view", { class: "detail-footer" }, [
  12358. vue.createElementVNode("view", { class: "divider" }),
  12359. vue.createElementVNode("text", { class: "footer-text" }, "如有疑问,请咨询在线客服。")
  12360. ])
  12361. ])
  12362. ]);
  12363. }
  12364. const PagesMineMessageDetail = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/message/detail.vue"]]);
  12365. const _imports_1 = "/static/icons/diamond_white.svg";
  12366. const _imports_2 = "/static/icons/star_decor.svg";
  12367. const bizTypeMap$1 = fulfillerEnum.FlfPointsBizType;
  12368. const _sfc_main$3 = {
  12369. data() {
  12370. return {
  12371. points: 0,
  12372. currentTab: 0,
  12373. list: [],
  12374. pageNum: 1,
  12375. pageSize: 10,
  12376. total: 0,
  12377. loading: false
  12378. };
  12379. },
  12380. computed: {
  12381. displayList() {
  12382. if (this.currentTab === 0)
  12383. return this.list;
  12384. const type = this.currentTab === 1 ? "income" : "expense";
  12385. return this.list.filter((item) => item.type === type);
  12386. }
  12387. },
  12388. onShow() {
  12389. this.fetchPoints();
  12390. this.fetchList(true);
  12391. },
  12392. onReachBottom() {
  12393. this.fetchList();
  12394. },
  12395. methods: {
  12396. async fetchPoints() {
  12397. try {
  12398. const res = await pointsOnApp();
  12399. if (res.code === 200) {
  12400. this.points = res.data || 0;
  12401. }
  12402. } catch (error) {
  12403. formatAppLog("error", "at pages/mine/points/index.vue:120", "获取当前积分失败", error);
  12404. }
  12405. },
  12406. async fetchList(reset = false) {
  12407. if (reset) {
  12408. this.pageNum = 1;
  12409. this.list = [];
  12410. this.total = 0;
  12411. }
  12412. if (this.loading)
  12413. return;
  12414. if (!reset && this.list.length >= this.total && this.total !== 0)
  12415. return;
  12416. this.loading = true;
  12417. try {
  12418. const res = await pagePointsOnApp({
  12419. pageNum: this.pageNum,
  12420. pageSize: this.pageSize
  12421. });
  12422. if (res.code === 200) {
  12423. this.total = res.total || 0;
  12424. const rows = res.rows || [];
  12425. const mappedRows = rows.map((item) => {
  12426. const isAdd = item.type === "add";
  12427. const uiType = isAdd ? "income" : "expense";
  12428. const title = bizTypeMap$1[item.bizType] || item.bizType || "其他";
  12429. let amountStr = Math.abs(item.amount);
  12430. if (!isAdd) {
  12431. amountStr = "-" + amountStr;
  12432. }
  12433. return {
  12434. ...item,
  12435. title,
  12436. desc: item.reason || "",
  12437. time: item.createTime || "",
  12438. amount: amountStr,
  12439. type: uiType,
  12440. tag: title
  12441. };
  12442. });
  12443. this.list = this.list.concat(mappedRows);
  12444. this.pageNum++;
  12445. }
  12446. } catch (error) {
  12447. formatAppLog("error", "at pages/mine/points/index.vue:163", "获取积分明细失败", error);
  12448. } finally {
  12449. this.loading = false;
  12450. }
  12451. },
  12452. navBack() {
  12453. uni.navigateBack();
  12454. },
  12455. navToDetail() {
  12456. uni.navigateTo({
  12457. url: "/pages/mine/points/detail"
  12458. });
  12459. },
  12460. navToEquity() {
  12461. },
  12462. switchTab(index) {
  12463. this.currentTab = index;
  12464. }
  12465. }
  12466. };
  12467. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  12468. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12469. vue.createElementVNode("view", { class: "nav-bar" }, [
  12470. vue.createElementVNode("view", {
  12471. class: "nav-left",
  12472. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12473. }, [
  12474. vue.createElementVNode("image", {
  12475. class: "back-icon",
  12476. src: _imports_0
  12477. })
  12478. ]),
  12479. vue.createElementVNode("text", { class: "nav-title" }, "我的积分"),
  12480. vue.createElementVNode("view", { class: "nav-right" })
  12481. ]),
  12482. vue.createElementVNode("view", { class: "points-card" }, [
  12483. vue.createElementVNode("view", { class: "card-header" }, [
  12484. vue.createElementVNode("view", {
  12485. class: "equity-btn",
  12486. onClick: _cache[1] || (_cache[1] = (...args) => $options.navToEquity && $options.navToEquity(...args))
  12487. }, [
  12488. vue.createElementVNode("image", {
  12489. class: "equity-icon",
  12490. src: _imports_1
  12491. }),
  12492. vue.createElementVNode("text", null, "积分权益")
  12493. ]),
  12494. vue.createElementVNode("view", {
  12495. class: "detail-link",
  12496. onClick: _cache[2] || (_cache[2] = (...args) => $options.navToDetail && $options.navToDetail(...args))
  12497. }, [
  12498. vue.createElementVNode("text", null, "明细")
  12499. ])
  12500. ]),
  12501. vue.createElementVNode("view", { class: "card-body" }, [
  12502. vue.createElementVNode("text", { class: "label" }, "当前积分"),
  12503. vue.createElementVNode(
  12504. "text",
  12505. { class: "value" },
  12506. vue.toDisplayString($data.points),
  12507. 1
  12508. /* TEXT */
  12509. )
  12510. ]),
  12511. vue.createElementVNode("image", {
  12512. class: "bg-decor",
  12513. src: _imports_2,
  12514. mode: "aspectFit"
  12515. })
  12516. ]),
  12517. vue.createElementVNode("view", { class: "record-container" }, [
  12518. vue.createElementVNode("view", { class: "record-header" }, [
  12519. vue.createElementVNode("text", { class: "header-title" }, "最近积分变动"),
  12520. vue.createElementVNode("view", {
  12521. class: "header-more",
  12522. onClick: _cache[3] || (_cache[3] = (...args) => $options.navToDetail && $options.navToDetail(...args))
  12523. }, [
  12524. vue.createElementVNode("text", null, "查看全部"),
  12525. vue.createElementVNode("image", {
  12526. class: "more-icon",
  12527. src: _imports_3
  12528. })
  12529. ])
  12530. ]),
  12531. vue.createElementVNode("view", { class: "tabs-row" }, [
  12532. vue.createElementVNode(
  12533. "view",
  12534. {
  12535. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 0 }]),
  12536. onClick: _cache[4] || (_cache[4] = ($event) => $options.switchTab(0))
  12537. },
  12538. [
  12539. vue.createElementVNode("text", null, "全部"),
  12540. $data.currentTab === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  12541. key: 0,
  12542. class: "tab-line"
  12543. })) : vue.createCommentVNode("v-if", true)
  12544. ],
  12545. 2
  12546. /* CLASS */
  12547. ),
  12548. vue.createElementVNode(
  12549. "view",
  12550. {
  12551. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 1 }]),
  12552. onClick: _cache[5] || (_cache[5] = ($event) => $options.switchTab(1))
  12553. },
  12554. [
  12555. vue.createElementVNode("text", null, "获取"),
  12556. $data.currentTab === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  12557. key: 0,
  12558. class: "tab-line"
  12559. })) : vue.createCommentVNode("v-if", true)
  12560. ],
  12561. 2
  12562. /* CLASS */
  12563. ),
  12564. vue.createElementVNode(
  12565. "view",
  12566. {
  12567. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 2 }]),
  12568. onClick: _cache[6] || (_cache[6] = ($event) => $options.switchTab(2))
  12569. },
  12570. [
  12571. vue.createElementVNode("text", null, "扣减"),
  12572. $data.currentTab === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  12573. key: 0,
  12574. class: "tab-line"
  12575. })) : vue.createCommentVNode("v-if", true)
  12576. ],
  12577. 2
  12578. /* CLASS */
  12579. )
  12580. ]),
  12581. vue.createElementVNode("view", { class: "record-list" }, [
  12582. (vue.openBlock(true), vue.createElementBlock(
  12583. vue.Fragment,
  12584. null,
  12585. vue.renderList($options.displayList, (item, index) => {
  12586. return vue.openBlock(), vue.createElementBlock("view", {
  12587. class: "list-item",
  12588. key: index
  12589. }, [
  12590. vue.createElementVNode("view", { class: "item-left" }, [
  12591. vue.createElementVNode(
  12592. "text",
  12593. { class: "item-title" },
  12594. vue.toDisplayString(item.title),
  12595. 1
  12596. /* TEXT */
  12597. ),
  12598. vue.createElementVNode(
  12599. "text",
  12600. { class: "item-desc" },
  12601. vue.toDisplayString(item.desc),
  12602. 1
  12603. /* TEXT */
  12604. ),
  12605. vue.createElementVNode(
  12606. "text",
  12607. { class: "item-time" },
  12608. vue.toDisplayString(item.time),
  12609. 1
  12610. /* TEXT */
  12611. )
  12612. ]),
  12613. vue.createElementVNode("view", { class: "item-right" }, [
  12614. vue.createElementVNode(
  12615. "text",
  12616. {
  12617. class: vue.normalizeClass(["item-amount", { income: item.type === "income", expense: item.type === "expense" }])
  12618. },
  12619. vue.toDisplayString(item.type === "income" ? "+" : "") + vue.toDisplayString(item.amount),
  12620. 3
  12621. /* TEXT, CLASS */
  12622. ),
  12623. vue.createElementVNode("view", { class: "item-tag" }, [
  12624. vue.createElementVNode(
  12625. "text",
  12626. null,
  12627. vue.toDisplayString(item.tag),
  12628. 1
  12629. /* TEXT */
  12630. )
  12631. ])
  12632. ])
  12633. ]);
  12634. }),
  12635. 128
  12636. /* KEYED_FRAGMENT */
  12637. ))
  12638. ])
  12639. ])
  12640. ]);
  12641. }
  12642. const PagesMinePointsIndex = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/points/index.vue"]]);
  12643. const bizTypeMap = fulfillerEnum.FlfPointsBizType;
  12644. const _sfc_main$2 = {
  12645. data() {
  12646. const d = /* @__PURE__ */ new Date();
  12647. return {
  12648. currentTab: 0,
  12649. year: d.getFullYear(),
  12650. month: d.getMonth() + 1,
  12651. groups: []
  12652. };
  12653. },
  12654. computed: {
  12655. currentDate() {
  12656. return `${this.year}-${String(this.month).padStart(2, "0")}`;
  12657. },
  12658. displayGroups() {
  12659. if (this.currentTab === 0)
  12660. return this.groups;
  12661. return this.groups.map((group) => {
  12662. const filteredItems = group.items.filter((item) => {
  12663. const type = this.currentTab === 1 ? "income" : "expense";
  12664. return item.type === type;
  12665. });
  12666. return {
  12667. ...group,
  12668. items: filteredItems
  12669. };
  12670. }).filter((group) => group.items.length > 0);
  12671. }
  12672. },
  12673. onShow() {
  12674. this.fetchData();
  12675. },
  12676. methods: {
  12677. async fetchData() {
  12678. try {
  12679. const res = await listPointsOnApp({
  12680. year: this.year,
  12681. month: this.month
  12682. });
  12683. if (res.code === 200) {
  12684. const list = res.data || [];
  12685. let incomeTotal = 0;
  12686. let expenseTotal = 0;
  12687. const items = list.map((item) => {
  12688. const isAdd = item.type === "add";
  12689. const uiType = isAdd ? "income" : "expense";
  12690. const title = bizTypeMap[item.bizType] || item.bizType || "其他";
  12691. let amountVal = Math.abs(item.amount);
  12692. if (isAdd) {
  12693. incomeTotal += amountVal;
  12694. } else {
  12695. expenseTotal += amountVal;
  12696. }
  12697. let amountStr = String(amountVal);
  12698. if (!isAdd)
  12699. amountStr = "-" + amountStr;
  12700. let timeStr = item.createTime || "";
  12701. if (timeStr.length >= 16) {
  12702. timeStr = timeStr.substring(5, 16);
  12703. }
  12704. return {
  12705. ...item,
  12706. title,
  12707. desc: item.reason || "",
  12708. time: timeStr,
  12709. amount: amountStr,
  12710. type: uiType,
  12711. tag: title
  12712. };
  12713. });
  12714. this.groups = [
  12715. {
  12716. month: `${this.month}月 ${this.year}`,
  12717. income: String(incomeTotal),
  12718. expense: String(expenseTotal),
  12719. items
  12720. }
  12721. ];
  12722. }
  12723. } catch (error) {
  12724. formatAppLog("error", "at pages/mine/points/detail.vue:174", "获取积分明细记录失败", error);
  12725. }
  12726. },
  12727. onDateChange(e) {
  12728. const val = e.detail.value;
  12729. const [y, m] = val.split("-");
  12730. this.year = parseInt(y, 10);
  12731. this.month = parseInt(m, 10);
  12732. this.fetchData();
  12733. },
  12734. navBack() {
  12735. uni.navigateBack();
  12736. },
  12737. switchTab(index) {
  12738. this.currentTab = index;
  12739. }
  12740. }
  12741. };
  12742. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  12743. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12744. vue.createElementVNode("view", { class: "nav-bar" }, [
  12745. vue.createElementVNode("view", {
  12746. class: "nav-left",
  12747. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12748. }, [
  12749. vue.createElementVNode("image", {
  12750. class: "back-icon",
  12751. src: _imports_0
  12752. })
  12753. ]),
  12754. vue.createElementVNode("text", { class: "nav-title" }, "积分明细"),
  12755. vue.createElementVNode("view", { class: "nav-right" })
  12756. ]),
  12757. vue.createElementVNode("view", { class: "content-area" }, [
  12758. vue.createElementVNode("view", { class: "filter-area" }, [
  12759. vue.createElementVNode("view", { class: "tabs-row" }, [
  12760. vue.createElementVNode(
  12761. "view",
  12762. {
  12763. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 0 }]),
  12764. onClick: _cache[1] || (_cache[1] = ($event) => $options.switchTab(0))
  12765. },
  12766. [
  12767. vue.createElementVNode("text", null, "全部"),
  12768. $data.currentTab === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  12769. key: 0,
  12770. class: "tab-line"
  12771. })) : vue.createCommentVNode("v-if", true)
  12772. ],
  12773. 2
  12774. /* CLASS */
  12775. ),
  12776. vue.createElementVNode(
  12777. "view",
  12778. {
  12779. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 1 }]),
  12780. onClick: _cache[2] || (_cache[2] = ($event) => $options.switchTab(1))
  12781. },
  12782. [
  12783. vue.createElementVNode("text", null, "获取"),
  12784. $data.currentTab === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  12785. key: 0,
  12786. class: "tab-line"
  12787. })) : vue.createCommentVNode("v-if", true)
  12788. ],
  12789. 2
  12790. /* CLASS */
  12791. ),
  12792. vue.createElementVNode(
  12793. "view",
  12794. {
  12795. class: vue.normalizeClass(["tab-item", { active: $data.currentTab === 2 }]),
  12796. onClick: _cache[3] || (_cache[3] = ($event) => $options.switchTab(2))
  12797. },
  12798. [
  12799. vue.createElementVNode("text", null, "扣减"),
  12800. $data.currentTab === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  12801. key: 0,
  12802. class: "tab-line"
  12803. })) : vue.createCommentVNode("v-if", true)
  12804. ],
  12805. 2
  12806. /* CLASS */
  12807. )
  12808. ]),
  12809. vue.createElementVNode("view", { class: "date-picker-wrap" }, [
  12810. vue.createElementVNode("picker", {
  12811. mode: "date",
  12812. fields: "month",
  12813. value: $options.currentDate,
  12814. onChange: _cache[4] || (_cache[4] = (...args) => $options.onDateChange && $options.onDateChange(...args))
  12815. }, [
  12816. vue.createElementVNode("view", { class: "date-picker" }, [
  12817. vue.createElementVNode(
  12818. "text",
  12819. { class: "date-text" },
  12820. vue.toDisplayString($data.year) + "年" + vue.toDisplayString(`${$data.month}`.padStart(2, "0")) + "月",
  12821. 1
  12822. /* TEXT */
  12823. ),
  12824. vue.createElementVNode("text", { class: "arrow-down" }, "﹀")
  12825. ])
  12826. ], 40, ["value"])
  12827. ])
  12828. ]),
  12829. vue.createElementVNode("scroll-view", {
  12830. "scroll-y": "",
  12831. class: "bill-list"
  12832. }, [
  12833. (vue.openBlock(true), vue.createElementBlock(
  12834. vue.Fragment,
  12835. null,
  12836. vue.renderList($options.displayGroups, (group, gIndex) => {
  12837. return vue.openBlock(), vue.createElementBlock("view", {
  12838. key: gIndex,
  12839. class: "month-group"
  12840. }, [
  12841. vue.createElementVNode("view", { class: "group-header" }, [
  12842. vue.createElementVNode(
  12843. "text",
  12844. { class: "month-title" },
  12845. vue.toDisplayString(group.month),
  12846. 1
  12847. /* TEXT */
  12848. ),
  12849. vue.createElementVNode(
  12850. "text",
  12851. { class: "month-summary" },
  12852. "获取 " + vue.toDisplayString(group.income) + " 扣减 " + vue.toDisplayString(group.expense),
  12853. 1
  12854. /* TEXT */
  12855. )
  12856. ]),
  12857. (vue.openBlock(true), vue.createElementBlock(
  12858. vue.Fragment,
  12859. null,
  12860. vue.renderList(group.items, (item, index) => {
  12861. return vue.openBlock(), vue.createElementBlock("view", {
  12862. class: "list-item",
  12863. key: index
  12864. }, [
  12865. vue.createElementVNode(
  12866. "view",
  12867. {
  12868. class: vue.normalizeClass(["item-icon-box", item.type])
  12869. },
  12870. [
  12871. vue.createElementVNode(
  12872. "text",
  12873. { class: "item-icon-symbol" },
  12874. vue.toDisplayString(item.type === "income" ? "+" : "-"),
  12875. 1
  12876. /* TEXT */
  12877. )
  12878. ],
  12879. 2
  12880. /* CLASS */
  12881. ),
  12882. vue.createElementVNode("view", { class: "item-center" }, [
  12883. vue.createElementVNode(
  12884. "text",
  12885. { class: "item-title" },
  12886. vue.toDisplayString(item.title),
  12887. 1
  12888. /* TEXT */
  12889. ),
  12890. vue.createElementVNode(
  12891. "text",
  12892. { class: "item-desc" },
  12893. vue.toDisplayString(item.time) + " " + vue.toDisplayString(item.desc),
  12894. 1
  12895. /* TEXT */
  12896. )
  12897. ]),
  12898. vue.createElementVNode("view", { class: "item-right" }, [
  12899. vue.createElementVNode(
  12900. "text",
  12901. {
  12902. class: vue.normalizeClass(["item-amount", { income: item.type === "income", expense: item.type === "expense" }])
  12903. },
  12904. vue.toDisplayString(item.type === "income" ? "+" : "") + vue.toDisplayString(item.amount),
  12905. 3
  12906. /* TEXT, CLASS */
  12907. ),
  12908. vue.createElementVNode("view", { class: "item-tag" }, [
  12909. vue.createElementVNode(
  12910. "text",
  12911. null,
  12912. vue.toDisplayString(item.tag),
  12913. 1
  12914. /* TEXT */
  12915. )
  12916. ])
  12917. ])
  12918. ]);
  12919. }),
  12920. 128
  12921. /* KEYED_FRAGMENT */
  12922. ))
  12923. ]);
  12924. }),
  12925. 128
  12926. /* KEYED_FRAGMENT */
  12927. )),
  12928. vue.createElementVNode("view", { class: "list-padding-bottom" })
  12929. ])
  12930. ])
  12931. ]);
  12932. }
  12933. const PagesMinePointsDetail = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/points/detail.vue"]]);
  12934. const _sfc_main$1 = {
  12935. data() {
  12936. return {
  12937. id: null,
  12938. title: "",
  12939. content: "",
  12940. loading: false
  12941. };
  12942. },
  12943. onLoad(options) {
  12944. if (options.id) {
  12945. this.id = options.id;
  12946. this.loadDetail();
  12947. }
  12948. },
  12949. methods: {
  12950. async loadDetail() {
  12951. if (!this.id)
  12952. return;
  12953. uni.showLoading({ title: "加载中..." });
  12954. try {
  12955. const res = await getAgreement(this.id);
  12956. if (res.code === 200 && res.data) {
  12957. this.title = res.data.title;
  12958. this.content = res.data.content;
  12959. uni.setNavigationBarTitle({ title: this.title });
  12960. } else {
  12961. uni.showToast({ title: res.msg || "获取失败", icon: "none" });
  12962. }
  12963. } catch (err) {
  12964. formatAppLog("error", "at pages/mine/settings/about/agreement-detail.vue:56", "获取协议详情失败:", err);
  12965. uni.showToast({ title: "网络错误", icon: "none" });
  12966. } finally {
  12967. uni.hideLoading();
  12968. }
  12969. },
  12970. navBack() {
  12971. uni.navigateBack({ delta: 1 });
  12972. }
  12973. }
  12974. };
  12975. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  12976. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  12977. vue.createElementVNode("view", { class: "custom-header" }, [
  12978. vue.createElementVNode("view", {
  12979. class: "header-left",
  12980. onClick: _cache[0] || (_cache[0] = (...args) => $options.navBack && $options.navBack(...args))
  12981. }, [
  12982. vue.createElementVNode("image", {
  12983. class: "back-icon",
  12984. src: _imports_0,
  12985. style: { "transform": "rotate(180deg)" }
  12986. })
  12987. ]),
  12988. vue.createElementVNode(
  12989. "text",
  12990. { class: "header-title" },
  12991. vue.toDisplayString($data.title || "协议详情"),
  12992. 1
  12993. /* TEXT */
  12994. ),
  12995. vue.createElementVNode("view", { class: "header-right" })
  12996. ]),
  12997. vue.createElementVNode("view", { class: "header-placeholder" }),
  12998. vue.createElementVNode("scroll-view", {
  12999. "scroll-y": "",
  13000. class: "content-scroll"
  13001. }, [
  13002. vue.createElementVNode("view", { class: "content-card" }, [
  13003. vue.createElementVNode("rich-text", {
  13004. nodes: $data.content,
  13005. class: "rich-text"
  13006. }, null, 8, ["nodes"])
  13007. ]),
  13008. vue.createElementVNode("view", { class: "safe-area-inset-bottom" })
  13009. ])
  13010. ]);
  13011. }
  13012. const PagesMineSettingsAboutAgreementDetail = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/pages/mine/settings/about/agreement-detail.vue"]]);
  13013. __definePage("pages/login/login", PagesLoginLogin);
  13014. __definePage("pages/recruit/landing", PagesRecruitLanding);
  13015. __definePage("pages/recruit/form", PagesRecruitForm);
  13016. __definePage("pages/recruit/auth", PagesRecruitAuth);
  13017. __definePage("pages/recruit/qualifications", PagesRecruitQualifications);
  13018. __definePage("pages/recruit/success", PagesRecruitSuccess);
  13019. __definePage("pages/login/reset-pwd-verify", PagesLoginResetPwdVerify);
  13020. __definePage("pages/login/reset-pwd-set", PagesLoginResetPwdSet);
  13021. __definePage("pages/home/index", PagesHomeIndex);
  13022. __definePage("pages/home/work-status", PagesHomeWorkStatus);
  13023. __definePage("pages/orders/index", PagesOrdersIndex);
  13024. __definePage("pages/orders/detail", PagesOrdersDetail);
  13025. __definePage("pages/orders/anomaly", PagesOrdersAnomaly);
  13026. __definePage("pages/mine/order-stats", PagesMineOrderStats);
  13027. __definePage("pages/mine/rewards", PagesMineRewards);
  13028. __definePage("pages/mine/rewards-all", PagesMineRewardsAll);
  13029. __definePage("pages/mine/index", PagesMineIndex);
  13030. __definePage("pages/mine/settings/index", PagesMineSettingsIndex);
  13031. __definePage("pages/mine/settings/profile/index", PagesMineSettingsProfileIndex);
  13032. __definePage("pages/mine/settings/auth/index", PagesMineSettingsAuthIndex);
  13033. __definePage("pages/mine/settings/auth/edit", PagesMineSettingsAuthEdit);
  13034. __definePage("pages/mine/settings/bank/index", PagesMineSettingsBankIndex);
  13035. __definePage("pages/mine/settings/security/index", PagesMineSettingsSecurityIndex);
  13036. __definePage("pages/mine/settings/profile/edit-name", PagesMineSettingsProfileEditName);
  13037. __definePage("pages/mine/settings/security/change-password", PagesMineSettingsSecurityChangePassword);
  13038. __definePage("pages/mine/settings/security/change-phone", PagesMineSettingsSecurityChangePhone);
  13039. __definePage("pages/mine/settings/notification/index", PagesMineSettingsNotificationIndex);
  13040. __definePage("pages/mine/settings/about/index", PagesMineSettingsAboutIndex);
  13041. __definePage("pages/mine/wallet/index", PagesMineWalletIndex);
  13042. __definePage("pages/mine/wallet/bill", PagesMineWalletBill);
  13043. __definePage("pages/mine/level/index", PagesMineLevelIndex);
  13044. __definePage("pages/mine/message/index", PagesMineMessageIndex);
  13045. __definePage("pages/mine/message/order", PagesMineMessageOrder);
  13046. __definePage("pages/mine/message/system", PagesMineMessageSystem);
  13047. __definePage("pages/mine/message/detail", PagesMineMessageDetail);
  13048. __definePage("pages/mine/points/index", PagesMinePointsIndex);
  13049. __definePage("pages/mine/points/detail", PagesMinePointsDetail);
  13050. __definePage("pages/mine/settings/about/agreement-detail", PagesMineSettingsAboutAgreementDetail);
  13051. const _sfc_main = {
  13052. onLaunch: function() {
  13053. formatAppLog("log", "at App.vue:7", "App Launch");
  13054. uni.removeStorageSync("recruit_form_data");
  13055. uni.removeStorageSync("recruit_auth_data");
  13056. uni.removeStorageSync("recruit_qual_data");
  13057. if (isLoggedIn()) {
  13058. startGpsTimer();
  13059. uni.switchTab({
  13060. url: "/pages/home/index"
  13061. });
  13062. }
  13063. },
  13064. onShow: function() {
  13065. formatAppLog("log", "at App.vue:22", "App Show");
  13066. },
  13067. onHide: function() {
  13068. formatAppLog("log", "at App.vue:25", "App Hide");
  13069. }
  13070. };
  13071. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/CodeProjects/Cursor/pet-system-fulfiller-app/App.vue"]]);
  13072. function createApp() {
  13073. const app = vue.createVueApp(App);
  13074. return {
  13075. app
  13076. };
  13077. }
  13078. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  13079. uni.Vuex = __Vuex__;
  13080. uni.Pinia = __Pinia__;
  13081. __app__.provide("__globalStyles", __uniConfig.styles);
  13082. __app__._component.mpType = "app";
  13083. __app__._component.render = () => {
  13084. };
  13085. __app__.mount("#app");
  13086. })(Vue);