import{_ as a}from"./uv-navbar.59911b60.js";import{f as e,N 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 v,g as f,d as m}from"./index-d76b1e7a.js";import{o as _,u as h,r as g}from"./useRouter.2bdb47a0.js";import{_ as j,a as b}from"./uv-checkbox-group.190cffdb.js";import{_ as k}from"./goods.b434f2b2.js";import{_ as x}from"./card.76ff4054.js";import{_ as I}from"./space.cecd0c54.js";import{_ as y}from"./layout.f8e9d577.js";import{j as C}from"./order.6c3b873a.js";import{_ as A}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"./product.b13622dd.js";import"./api.9246a192.js";import"./useInterface.5df3648b.js";import"./index.30cfb093.js";const w=A({__name:"selectRefundGood",setup(A){const{getParams:w,push:P,goBack:U}=h(),V=e([]),q=e([]),N=e(!1),S=e(0),E=e(null),F=e(null),L=e(null),R=e(0),B=a=>{N.value=a,N.value?q.value=V.value.map((a=>a.cartInfo.productAttrUnique)):q.value=[]},G=a=>{N.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})),S.value=e}));const O=a=>{q.value.length<=0||(L.value=a,P({url:"/pages/refund/refund"},{data:{refundType:L.value,goods:q.value.toString(),orderId:E.value,id:F.value}}))};return _((a=>{const e=w(a);E.value=e.orderId,F.value=e.id,R.value=e.status,(async a=>{const e=await C(a);V.value=e})({key:e.id})})),(e,t)=>{const _=g(f("uv-navbar"),a),h=g(f("uv-checkbox"),j),C=g(f("goods"),k),A=m,w=g(f("card"),x),P=g(f("space"),I),E=g(f("uv-checkbox-group"),b),F=g(f("layout"),y);return o(),l(F,null,{default:s((()=>[u(_,{fixed:!1,title:"选择商品","left-arrow":"",onLeftClick:r(U)},null,8,["onLeftClick"]),V.value?(o(),l(E,{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(h,{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(E,{shape:"circle",activeColor:"#ec6e47"},{default:s((()=>[u(h,{name:"all",checked:N.value,onChange:B},{default:s((()=>[p(" 全选 ")])),_:1},8,["checked"])])),_:1})])),_:1}),u(A,{class:"action-total"},{default:s((()=>[p(v(q.value.length)+" 件商品 ",1)])),_:1}),u(A,{class:"action-total"},{default:s((()=>[p(" 总计：￥"+v(S.value),1)])),_:1})])),_:1}),u(A,{class:"action-btns"},{default:s((()=>[u(A,{class:"button only-button",onClick:t[1]||(t[1]=a=>O(0))},{default:s((()=>[p(" 仅退款 ")])),_:1}),0!==R.value?(o(),l(A,{key:0,class:"button",onClick:t[2]||(t[2]=a=>O(1))},{default:s((()=>[p(" 退货退款 ")])),_:1})):d("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-61e6c231"]]);export{w as default};
