import{_ as e}from"./uv-navbar.59911b60.js";import{f as a,y as t,o,c as s,w as l,a as i,u as r,h as u,t as n,b as c,r as d,F as p,A as m,W as f,k as _,g as v,d as j,m as h,P as g}from"./index-d76b1e7a.js";import{o as k,r as y,u as w}from"./useRouter.2bdb47a0.js";import{_ as x,a as C}from"./uv-checkbox-group.190cffdb.js";import{_ as b}from"./goods.b434f2b2.js";import{_ as I,a as V}from"./uv-swipe-action.8756f5c3.js";import{_ as L}from"./card.76ff4054.js";import{_ as N}from"./space.cecd0c54.js";import{_ as S}from"./container.79005cf0.js";import{_ as E}from"./layout.f8e9d577.js";import{f as M,i as P,j as A}from"./product.b13622dd.js";import{M as B}from"./index.31bfccff.js";import{u as D}from"./usePage.e20fbf49.js";import{E as F}from"./index.81294ba6.js";import{e as R}from"./收藏.f26ff3a3.js";import{u as U}from"./useInterface.5df3648b.js";import{_ as K}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.66ab7702.js";/* empty css                                                                      */import"./uv-icon.5730d4d2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_8d8b32e4_lang.3fde2b65.js";import"./uv-button.dcfcbf96.js";import"./uv-transition.b33e1d5c.js";import"./good-attr-select.1f1b5e35.js";import"./uv-image.e629c74e.js";import"./index.30cfb093.js";import"./api.9246a192.js";const O=K({__name:"footprint",setup(K){const{goBack:O,push:T}=w(),{type:W,refresh:X,dataList:Y}=D(M),{toast:Z}=U(),$=a([{text:"删除",style:{backgroundColor:"#f56c6c"}}]),q=a(!1);const z=a([]),G=t({get:()=>r(z).length===r(Y).length?[1]:[],set:()=>{}});function H(e){z.value=e.includes(1)?Y.value.map((e=>e.id)):[]}const J=a();let Q;function ee(e=!1,a){if(e)Q=a;else if(r(z).length<=0)return Z({title:"请先选择足迹"});r(J).show()}function ae(){Q?async function(){await P(Q),await X(),await Z({title:"删除成功"})}():async function(){const e=[];r(Y).forEach((a=>{r(z).includes(a.id)&&e.push(a.productId)}));const a={productIdList:e};await A(a),await X(),await Z({title:"删除成功"}),z.value=[],te()}()}function te(){Q=void 0}return k((async e=>{W.value="foot",await X()})),(a,t)=>{const k=y(v("uv-navbar"),e),w=j,M=y(v("uv-checkbox"),x),P=y(v("goods"),b),A=y(v("uv-swipe-action-item"),I),D=y(v("card"),L),U=y(v("uv-checkbox-group"),C),K=y(v("space"),N),W=y(v("uv-swipe-action"),V),X=y(v("container"),S),Z=y(v("layout"),E);return o(),s(Z,null,{default:l((()=>[i(k,{fixed:!1,title:"我的足迹","left-arrow":"",onLeftClick:r(O)},null,8,["onLeftClick"]),i(w,{class:"top-option"},{default:l((()=>[i(w),i(w,{class:"btn",onClick:t[0]||(t[0]=e=>function(e=!0){z.value=[],q.value=e}(!q.value))},{default:l((()=>[u(n(q.value?"完成":"管理"),1)])),_:1})])),_:1}),i(X,null,{default:l((()=>[i(W,null,{default:l((()=>[i(K,{direction:"vertical",fill:""},{default:l((()=>[r(Y).length>0?(o(),s(U,{key:0,modelValue:z.value,"onUpdate:modelValue":t[1]||(t[1]=e=>z.value=e),shape:"circle",activeColor:"#ec6e47"},{default:l((()=>[(o(!0),c(p,null,d(r(Y),(e=>(o(),s(w,{class:"select-row",key:e.id},{default:l((()=>[q.value?(o(),s(M,{key:0,customStyle:{marginBottom:"8px"},name:e.id},null,8,["name"])):h("",!0),i(D,{style:{width:"100%"},onClick:a=>function(e){q.value&&g((()=>{const a=r(z).findIndex((a=>a===e.id));a>=0?r(z).splice(a,1):r(z).push(e.id)}))}(e)},{default:l((()=>[i(A,{disabled:q.value,options:$.value,onClick:a=>ee(!0,e)},{default:l((()=>[i(P,{list:"",data:e,storeName:e.storeName,price:e.price,stock:e.stock,interval:"true",desc:"3",showAction:"true",surplus:"200",priceMode:"primary",onClick:a=>r(T)({url:"/pages/goodsDetail/goodsDetail"},{data:{id:e.productId}})},null,8,["data","storeName","price","stock","onClick"])])),_:2},1032,["disabled","options","onClick"])])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1},8,["modelValue"])):(o(),s(F,{key:1,iconSrc:r(R)},{default:l((()=>[u(" 您还没有浏览足迹~ ")])),_:1},8,["iconSrc"]))])),_:1})])),_:1}),i(w,{class:"option-height"}),i(w,{class:"option-row",style:m({height:q.value?"100rpx":"0rpx"})},{default:l((()=>[i(w,{class:"left"},{default:l((()=>[i(U,{modelValue:r(G),"onUpdate:modelValue":t[2]||(t[2]=e=>f(G)?G.value=e:null),shape:"circle",activeColor:"#ec6e47",onChange:H},{default:l((()=>[i(M,{shape:"circle",activeColor:"#ec6e47",name:1},{default:l((()=>[_("span",{class:"all-select"},"全选")])),_:1})])),_:1},8,["modelValue"])])),_:1}),i(w,{class:"button",onClick:t[3]||(t[3]=e=>ee(!1))},{default:l((()=>[u(" 删除 ")])),_:1})])),_:1},8,["style"])])),_:1}),i(B,{ref_key:"deleteModal",ref:J,content:"确认要删除所选内容吗？",onConfirm:ae,onCancel:te},null,512)])),_:1})}}},[["__scopeId","data-v-9a23a143"]]);export{O as default};
