import{C as t,p as a,D as s,o as e,e as o,w as n,s as l,_ as i,b as r,i as c,k as u,f as d,h as p,F as _,d as f,m,u as g,y,z as b,j as x,O as k,A as v,B as w}from"./index-520dfaee.js";import{_ as j}from"./su-tabs.251eecb0.js";import{_ as C}from"./su-sticky.4736fd36.js";import{_ as T}from"./s-empty.b6c95127.js";import{_ as h}from"./s-goods-item.cceb2670.js";import{_ as S}from"./uni-load-more.ba4f287c.js";import{a as $}from"./s-layout.5146c957.js";import{_ as A}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                *//* empty css                                                                     */const M=A({__name:"list",setup(A){const M={data:[],current_page:1,total:1,last_page:1},q=t({currentTab:0,showApply:!1,pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:""}),z=[{name:"全部",value:"all"},{name:"申请中",value:"nooper"},{name:"处理中",value:"ing"},{name:"已完成",value:"completed"},{name:"已拒绝",value:"refuse"}];function B(t){q.pagination=M,q.currentTab=t.index,D()}async function D(t=1,a=5){q.loadStatus="loading";let s=await l.$api.order.aftersale.list({type:z[q.currentTab].value,list_rows:a,page:t});if(1===s.code){let t=i.concat(q.pagination.data,s.data.data);q.pagination={...s.data,data:t},q.pagination.current_page<q.pagination.last_page?q.loadStatus="more":q.loadStatus="noMore"}}function F(){"noMore"!==q.loadStatus&&D(q.pagination.current_page+1)}return a((async t=>{t.type&&(q.currentTab=t.type),D()})),s((()=>{F()})),(t,a)=>{const s=r(f("su-tabs"),j),i=r(f("su-sticky"),C),A=r(f("s-empty"),T),I=v,O=m,E=r(f("s-goods-item"),h),G=w,H=r(f("uni-load-more"),S),J=r(f("s-layout"),$);return e(),o(J,{title:"售后列表"},{default:n((()=>[c(i,{bgColor:"#fff"},{default:n((()=>[c(s,{list:z,scrollable:!1,onChange:B,current:q.currentTab},null,8,["current"])])),_:1}),0===q.pagination.total?(e(),o(A,{key:0,icon:"/static/data-empty.png",text:"暂无数据"})):u("",!0),q.pagination.total>0?(e(),o(O,{key:1},{default:n((()=>[(e(!0),d(_,null,p(q.pagination.data,(t=>(e(),o(O,{class:"list-box ss-m-y-20",key:t.id,onClick:a=>g(l).$router.go("/pages/order/aftersale/detail",{id:t.id})},{default:n((()=>[c(O,{class:"order-head ss-flex ss-col-center ss-row-between"},{default:n((()=>[c(I,{class:"no"},{default:n((()=>[y("服务单号："+b(t.aftersale_sn),1)])),_:2},1024),c(I,{class:"state"},{default:n((()=>[y(b(t.aftersale_status_text),1)])),_:2},1024)])),_:2},1024),c(E,{img:t.goods_image,title:t.goods_title,skuText:t.goods_sku_text,price:t.goods_price,num:t.goods_num},null,8,["img","title","skuText","price","num"]),c(O,{class:"apply-box ss-flex ss-col-center ss-row-between border-bottom ss-p-x-20"},{default:n((()=>[c(O,{class:"ss-flex ss-col-center"},{default:n((()=>[c(O,{class:"title ss-m-r-20"},{default:n((()=>[y(b(t.type_text),1)])),_:2},1024),c(O,{class:"value"},{default:n((()=>[y(b(t.aftersale_status_desc),1)])),_:2},1024)])),_:2},1024),c(I,{class:"_icon-forward"})])),_:2},1024),c(O,{class:"tool-btn-box ss-flex ss-col-center ss-row-right ss-p-r-20"},{default:n((()=>[c(O,null,{default:n((()=>[t.btns.includes("cancel")?(e(),o(G,{key:0,class:"ss-reset-button tool-btn",onClick:x((a=>{return s=t.id,void k({title:"提示",content:"确定要取消此申请吗？",success:async function(t){if(t.confirm){const{code:t}=await l.$api.order.aftersale.cancel(s);1===t&&(q.pagination=M,D())}}});var s}),["stop"])},{default:n((()=>[y("取消申请")])),_:2},1032,["onClick"])):u("",!0)])),_:2},1024),c(O,null,{default:n((()=>[t.btns.includes("delete")?(e(),o(G,{key:0,class:"ss-reset-button tool-btn",onClick:x((a=>{return s=t.id,void k({title:"提示",content:"确定要删除吗？",success:async function(t){if(t.confirm){const{code:t}=await l.$api.order.aftersale.delete(s);1===t&&(q.pagination=M,D())}}});var s}),["stop"])},{default:n((()=>[y("删除")])),_:2},1032,["onClick"])):u("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):u("",!0),q.pagination.total>0?(e(),o(H,{key:2,status:q.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:F},null,8,["status"])):u("",!0)])),_:1})}}},[["__scopeId","data-v-a878ac10"]]);export{M as default};
