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