import{v as t,o as a,x as s,r as e,e as o,f as l,w as n,j as i,k as r,g as c,l as u,m as p,F as d,i as f,u as m,s as g,p as _,t as y,B as b,M as x,C as j,D as k}from"./index-CWyPMHxb.js";import{_ as w}from"./su-tabs.DxDBdwpZ.js";import{_ as S}from"./su-sticky.BtoGKIZA.js";import{_ as v}from"./s-empty.Bcpb-H16.js";import{_ as h}from"./s-goods-item.DVomrksC.js";import{_ as C}from"./uni-load-more.jm2vzrn1.js";import{S as N}from"./s-layout.CUgh1tQ8.js";import{p as T,q as A,r as z}from"./useGoods.BQLkjza8.js";import{A as M}from"./afterSale.BAu4Afo0.js";import{r as q}from"./index.gxKvznCa.js";import{_ as P}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{l as B}from"./lodash.default.DzSjahpS.js";import"./min.DNgEVQjj.js";const D=P({__name:"list",setup(P){const D=t({currentTab:0,showApply:!1,pagination:{list:[],total:0,pageNo:1,pageSize:10},loadStatus:""}),E=[{name:"全部",value:"all"}];function F(t){q(D.pagination),D.currentTab=t.index,G()}async function G(){D.loadStatus="loading";let{data:t,code:a}=await M.getAfterSalePage({pageNo:D.pagination.pageNo,pageSize:D.pagination.pageSize});0===a&&(t.list.forEach((t=>T(t))),D.pagination.list=B.concat(D.pagination.list,t.list),D.pagination.total=t.total,D.loadStatus=D.pagination.list.length<D.pagination.total?"more":"noMore")}function I(){"noMore"!==D.loadStatus&&(D.pagination.pageNo++,G())}return a((async t=>{t.type&&(D.currentTab=t.type),await G()})),s((()=>{I()})),(t,a)=>{const s=e(o("su-tabs"),w),T=e(o("su-sticky"),S),P=e(o("s-empty"),v),B=j,U=f,Z=e(o("s-goods-item"),h),$=k,H=e(o("uni-load-more"),C),J=e(o("s-layout"),N);return i(),l(J,{title:"售后列表"},{default:n((()=>[r(T,{bgColor:"#fff"},{default:n((()=>[r(s,{list:E,scrollable:!1,onChange:F,current:D.currentTab},null,8,["current"])])),_:1}),0===D.pagination.total?(i(),l(P,{key:0,icon:"/static/data-empty.png",text:"暂无数据"})):c("",!0),D.pagination.total>0?(i(),l(U,{key:1},{default:n((()=>[(i(!0),u(d,null,p(D.pagination.list,(t=>(i(),l(U,{class:"list-box ss-m-y-20",key:t.id,onClick:a=>m(g).$router.go("/pages/order/aftersale/detail",{id:t.id})},{default:n((()=>[r(U,{class:"order-head ss-flex ss-col-center ss-row-between"},{default:n((()=>[r(B,{class:"no"},{default:n((()=>[_("服务单号："+y(t.no),1)])),_:2},1024),r(B,{class:"state"},{default:n((()=>[_(y(m(A)(t)),1)])),_:2},1024)])),_:2},1024),r(Z,{img:t.picUrl,title:t.spuName,skuText:t.properties.map((t=>t.valueName)).join(" "),price:t.refundPrice},null,8,["img","title","skuText","price"]),r(U,{class:"apply-box ss-flex ss-col-center ss-row-between border-bottom ss-p-x-20"},{default:n((()=>[r(U,{class:"ss-flex ss-col-center"},{default:n((()=>[r(U,{class:"title ss-m-r-20"},{default:n((()=>[_(y(10===t.way?"仅退款":"退款退货"),1)])),_:2},1024),r(U,{class:"value"},{default:n((()=>[_(y(m(z)(t)),1)])),_:2},1024)])),_:2},1024),r(B,{class:"_icon-forward"})])),_:2},1024),r(U,{class:"tool-btn-box ss-flex ss-col-center ss-row-right ss-p-r-20"},{default:n((()=>[r(U,null,{default:n((()=>[(null==t?void 0:t.buttons.includes("cancel"))?(i(),l($,{key:0,class:"ss-reset-button tool-btn",onClick:b((a=>{return s=t.id,void x({title:"提示",content:"确定要取消此申请吗？",success:async function(t){if(!t.confirm)return;const{code:a}=await M.cancelAfterSale(s);0===a&&(q(D.pagination),await G())}});var s}),["stop"])},{default:n((()=>[_("取消申请")])),_:2},1032,["onClick"])):c("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):c("",!0),D.pagination.total>0?(i(),l(H,{key:2,status:D.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:I},null,8,["status"])):c("",!0)])),_:1})}}},[["__scopeId","data-v-5cc9d088"]]);export{D as default};
