after-sale.b13503b6.js 7.0 KB

1
  1. var I=Object.defineProperty,j=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var y=(t,r,s)=>r in t?I(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,h=(t,r)=>{for(var s in r||(r={}))C.call(r,s)&&y(t,s,r[s]);if(f)for(var s of f(r))b.call(r,s)&&y(t,s,r[s]);return t},p=(t,r)=>j(t,A(r));import{C as D}from"./index.0d4e04d4.js";import{r as n,s as R,C as B}from"./index.d925b97f.js";import{d as N,T as c,D as k,a as e,G as F,H as O,F as g,w as P,C as S,q as m,B as d,j as u,x as T,A as v,m as w}from"./vendor.ad13860b.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{s as i,I as G}from"./item.e4367047.js";/* empty css */import"./cart.b12363c1.js";function E(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!T(t)}const L={0:"\u5F85\u5904\u7406",1:"\u9000\u8D27\u4E2D",2:"\u5DF2\u5B8C\u6210",3:"\u5DF2\u62D2\u7EDD"};var st=N({name:"after-sale",data(){return{active:"0",list:[],dataShow:!0,loading:!1,finished:!1,show:!1,kmsShow:!1,params:{pageNum:1,pageSize:20},returnGood:{},reason:"",returnOrderSn:"",returnGoodId:0}},watch:{active(){this.init(),this.getList()}},mounted(){this.getList()},methods:{init(){this.params.pageNum=1,this.finished=!1,this.list=[]},async getList(){var r,s;if(this.dataShow=!0,this.loading&&this.finished)return;this.loading=!0;let t;if(this.active==="0"?t=await this.getIsReturnOrderList():t=await this.getReturnList(),((r=t==null?void 0:t.data)==null?void 0:r.list)||(this.dataShow=!1),t.code===200&&t.data.list){let a=t.data;if(Array.isArray(a.list)){let o=[];for(let l=0;l<a.list.length;l++)a.list[l].orderItemList?a.list[l].orderItemList.findIndex(x=>x.returnStatus<0)>-1&&o.push(a.list[l]):o.push(a.list[l]);this.list=this.list.concat(this.list,o)}this.params.pageNum=t.data.pageNum+1}this.finished=this.params.pageNum>=((s=t==null?void 0:t.data)==null?void 0:s.totalPage),this.loading=!1},async getIsReturnOrderList(){try{return await n.get("/api-mall-portal/order/list",{params:p(h({},this.params),{status:"1,2,3"})})}catch{}return{}},async getReturnList(){try{return await n.post("/api-mall-portal/returnApply/list",{data:p(h({},this.params),{status:this.active==="1"?"0,1":"2,3"})})}catch{}return{}},setReturnParams(t,r){this.returnGood.memberUsername=R.user.data.username,this.returnGood.orderId=t.id,this.returnGood.orderSn=t.orderSn,this.returnGood.productAttr=r.productAttr,this.returnGood.productBrand=r.productBrand,this.returnGood.productCount=r.productQuantity,this.returnGood.productId=r.productId,this.returnGood.productName=r.productName,this.returnGood.productPic=r.productPic,this.returnGood.productPrice=r.productPrice,this.returnGood.productRealPrice=r.productPrice,this.returnGood.proofPics="",this.returnGood.returnName=t.receiverName,this.returnGood.returnPhone=t.receiverPhone,this.returnGood.orderItemId=r.id,console.log(this.returnGood)},async setReturnShop(){if(!this.reason){c("\u8BF7\u586B\u5199\u9000\u8D27\u539F\u56E0!");return}try{(await n.post("/api-mall-portal/returnApply/create",{data:p(h({},this.returnGood),{reason:this.reason})})).code===200&&(c({message:"\u9000\u8D27\u7533\u8BF7\u6210\u529F",icon:"success"}),setTimeout(()=>{this.show=!1,this.reason="",this.returnOrderSn="",this.active="1"},500))}catch{}this.returnGood={}},async setReturnApplySn(){if(!this.returnOrderSn){c("\u8BF7\u586B\u5199\u9000\u8D27\u5FEB\u9012\u5355\u53F7");return}try{let{code:t,data:r}=await n.post("/api-mall-portal/returnApply/deliverySn",{data:{deliverySn:this.returnOrderSn,id:this.returnGoodId}});t===200&&(this.returnOrderSn="",this.kmsShow=!1,this.init(),this.getList())}catch{}},deleteReturnApply(){k.confirm({title:"\u63D0\u793A",message:"\u662F\u5426\u64A4\u9500\u9000\u8D27\u7533\u8BF7?",confirmButtonText:"\u64A4\u9500",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{let{code:t,data:r}=await n.post("/api-mall-portal/returnApply/delete/"+this.returnGoodId);t===200&&(this.init(),this.getList())}catch{}})}},render(){let t;const r=[{name:"0",title:"\u5168\u90E8"},{name:"1",title:"\u5904\u7406\u4E2D"},{name:"2",title:"\u5DF2\u5904\u7406"}];return e("div",{class:i.shopOrder},[e(D,null,null),e(F,{active:this.active,"onUpdate:active":s=>this.active=s,color:"var(--van-primary)",lineWidth:28,animated:!0,swipeable:!0},E(t=r.map(s=>e(O,{name:s.name,title:s.title},{default:()=>[this.dataShow?e(g,null,[this.list.length?e(P,{loading:this.loading,finished:this.finished,finishedText:" ",class:[i.goodsList],onLoad:this.getList},{default:()=>[this.active===s.name&&this.list.map(a=>e(g,null,[a.orderItemList&&a.orderItemList.length?a.orderItemList.map(o=>e(S,{class:i.cellGroup},{default:()=>[e(G,{item:o},null),e(m,{center:!0},{default:()=>e("div",{class:i.btnList},[this.active==="0"&&(a.status!==0||a.status!==6)&&o.returnStatus<0?e(d,{size:"small",round:!0,type:"primary",onClick:()=>{this.show=!0,this.setReturnParams(a,o)}},{default:()=>[u("\u9000\u8D27\u7533\u8BF7")]}):null,o.returnStatus>=0?e("div",null,[L[o.returnStatus]]):null])})]})):e(S,{class:i.cellGroup},{default:()=>[e(m,{title:a.createTime,titleClass:i.payTime,value:L[a.status]},null),e(G,{item:a},null),e(m,{center:!0},{default:()=>e("div",{class:i.btnList},[a.status===1&&!a.deliverySn?e(d,{size:"small",round:!0,onClick:()=>{this.returnGoodId=a.id,this.kmsShow=!0}},{default:()=>[u("\u586B\u5199\u9000\u8D27\u5FEB\u9012\u5355\u53F7")]}):null,a.status<=1?e(d,{size:"small",round:!0,type:"primary",onClick:()=>{this.returnGoodId=a.id,this.deleteReturnApply()}},{default:()=>[u("\u64A4\u9500\u7533\u8BF7")]}):null,a.status===2?e("div",{class:i.returnDes},[u("\u8BE5\u5546\u54C1\u91D1\u989D\u5DF2\u4E8E "),a.handleTime," ",u("\u539F\u8DEF\u9000\u8FD8")]):a.status===3?e("div",{class:i.returnDes},[u("\u62D2\u7EDD\u539F\u56E0: "),a.handleNote]):null])})]})]))]}):e(B,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u6570\u636E"},null)]):null]})))?t:{default:()=>[t]}),e(v,{show:this.show,"onUpdate:show":s=>this.show=s,title:"\u9000\u8D27\u539F\u56E0"},{default:()=>[e("div",{style:{paddingTop:"15px"}},[e(w,{class:[i.field],placeholder:"\u8BF7\u8F93\u5165\u9000\u8D27\u539F\u56E0",type:"textarea",rows:3,modelValue:this.reason,"onUpdate:modelValue":s=>this.reason=s},null)]),e("div",{class:i["btn-group"]},[e(d,{type:"primary",block:!0,round:!0,onClick:()=>this.setReturnShop()},{default:()=>[u("\u786E\u5B9A")]})])]}),e(v,{show:this.kmsShow,"onUpdate:show":s=>this.kmsShow=s,title:"\u586B\u5199\u9000\u8D27\u5FEB\u9012\u5355\u53F7"},{default:()=>[e(w,{modelValue:this.returnOrderSn,"onUpdate:modelValue":s=>this.returnOrderSn=s,class:[i.field],placeholder:"\u8BF7\u8F93\u5165\u9000\u8D27\u5FEB\u9012\u5355\u53F7"},null),e("div",{class:i["btn-group"]},[e(d,{type:"primary",block:!0,round:!0,onClick:()=>this.setReturnApplySn()},{default:()=>[u("\u786E\u5B9A")]})])]})])}});export{st as default};