import{_ as a}from"./uv-navbar.31c484ad.js";import{f as e,E as t,o,c as l,w as s,a as u,u as r,b as c,r as n,F as i,m as d,h as p,t as f,g as v,d as m}from"./index-3714412c.js";import{o as _,u as g,r as h}from"./useRouter.f44141c1.js";import{_ as j,a as b}from"./uv-checkbox-group.93885f58.js";import{_ as k}from"./goods.46695bdd.js";import{_ as I}from"./card.65aaf97b.js";import{_ as x}from"./space.57299547.js";import{_ as y}from"./layout.99605750.js";import{j as C}from"./order.770d13ec.js";import{_ as A}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.b515a02d.js";import"./uv-icon.c593f91d.js";import"./uv-button.14a976f7.js";import"./uv-loading-icon.8ba359c8.js";import"./good-attr-select.1541fb80.js";import"./uv-image.7b0e6bd2.js";import"./uv-transition.4f5b62a8.js";import"./product.d7200236.js";import"./api.966d6934.js";import"./useInterface.f3e95e31.js";import"./index.d0119d7e.js";/* empty css                                                             */const w=A({__name:"selectRefundGood",setup(A){const{getParams:w,push:P,goBack:U}=g(),V=e([]),q=e([]),E=e(!1),R=e(0),S=e(null),L=e(null),B=e(null),D=e(0),F=a=>{E.value=a,E.value?q.value=V.value.map((a=>a.cartInfo.productAttrUnique)):q.value=[]},G=a=>{E.value=a.length===V.value.length};t(q,(a=>{let e=0;V.value.filter((e=>a.includes(e.cartInfo.productAttrUnique))).forEach((a=>{e+=a.cartInfo.truePrice*a.cartInfo.cartNum})),R.value=e}));const J=a=>{q.value.length<=0||(B.value=a,P({url:"/pages/refund/refund"},{data:{refundType:B.value,goods:q.value.toString(),orderId:S.value,id:L.value}}))};return _((a=>{const e=w(a);S.value=e.orderId,L.value=e.id,D.value=e.status,(async a=>{const e=await C(a);V.value=e})({key:e.id})})),(e,t)=>{const _=h(v("uv-navbar"),a),g=h(v("uv-checkbox"),j),C=h(v("goods"),k),A=m,w=h(v("card"),I),P=h(v("space"),x),S=h(v("uv-checkbox-group"),b),L=h(v("layout"),y);return o(),l(L,null,{default:s((()=>[u(_,{fixed:!1,title:"选择商品","left-arrow":"",onLeftClick:r(U)},null,8,["onLeftClick"]),V.value?(o(),l(S,{key:0,modelValue:q.value,"onUpdate:modelValue":t[0]||(t[0]=a=>q.value=a),shape:"circle",activeColor:"#ec6e47",onChange:G},{default:s((()=>[u(P,{direction:"vertical",fill:""},{default:s((()=>[u(w,{class:"shopping-checkbox"},{default:s((()=>[(o(!0),c(i,null,n(V.value,((a,e)=>(o(),l(A,{class:"shopping-checkbox-cell"},{default:s((()=>[u(g,{name:a.cartInfo.productAttrUnique,disabled:1!=a.isAfterSales},null,8,["name","disabled"]),u(C,{list:"",interval:"",showAction:"",model:"",price:a.cartInfo.truePrice,data:a.cartInfo.productInfo},null,8,["price","data"])])),_:2},1024)))),256))])),_:1})])),_:1})])),_:1},8,["modelValue"])):d("",!0),u(A,{class:"action-bar column"},{default:s((()=>[u(A,{class:"action-info"},{default:s((()=>[u(A,{class:"action-checkbox"},{default:s((()=>[u(S,{shape:"circle",activeColor:"#ec6e47"},{default:s((()=>[u(g,{name:"all",checked:E.value,onChange:F},{default:s((()=>[p(" 全选 ")])),_:1},8,["checked"])])),_:1})])),_:1}),u(A,{class:"action-total"},{default:s((()=>[p(f(q.value.length)+" 件商品 ",1)])),_:1}),u(A,{class:"action-total"},{default:s((()=>[p(" 总计：￥"+f(R.value),1)])),_:1})])),_:1}),u(A,{class:"action-btns"},{default:s((()=>[u(A,{class:"button only-button",onClick:t[1]||(t[1]=a=>J(0))},{default:s((()=>[p(" 仅退款 ")])),_:1}),0!==D.value?(o(),l(A,{key:0,class:"button",onClick:t[2]||(t[2]=a=>J(1))},{default:s((()=>[p(" 退货退款 ")])),_:1})):d("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-61e6c231"]]);export{w as default};
