after-sale-legacy.ed983abd.js 9.7 KB

1
  1. !function(){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var u=null!=arguments[n]?arguments[n]:{};n%2?e(Object(u),!0).forEach((function(e){r(t,e,u[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(u)):e(Object(u)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(u,e))}))}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,u,a,i){try{var o=e[a](i),s=o.value}catch(c){return void r(c)}o.done?t(s):Promise.resolve(s).then(n,u)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(u,a){var i=e.apply(t,r);function o(e){n(i,u,a,o,s,"next",e)}function s(e){n(i,u,a,o,s,"throw",e)}o(void 0)}))}}System.register(["./index-legacy.5d15d97d.js","./index-legacy.f5ec68b4.js","./index-legacy.0c3e2f42.js","./index-legacy.046e36c1.js","./index-legacy.1501ee8b.js","./index-legacy.892f3e6e.js","./index-legacy.d0618c5f.js","./index-legacy.397b31b5.js","./index-legacy.152e9903.js","./index-legacy.1885417e.js","./item-legacy.164d0552.js","./index-legacy.b58baed3.js","./use-height-legacy.6e14aad7.js","./use-id-legacy.120debac.js","./use-tab-status-legacy.93223311.js","./use-refs-legacy.ae6c29f2.js","./index-legacy.c6d91c78.js","./cart-legacy.b6cb78f4.js"],(function(e){"use strict";var r,n,a,i,o,s,c,l,d,p,f,m,h,g,v,y,b,w,x,S,j;return{setters:[function(e){r=e.d,n=e.w,a=e.g,i=e.T,o=e.D,s=e.j,c=e.F,l=e.B,d=e.z,p=e.C,f=e.Z},function(e){m=e.C},function(e){h=e.A},function(e){g=e.C},function(e){v=e.C},function(e){y=e.F},function(e){b=e.L},function(){},function(){},function(e){w=e.T,x=e.a},function(e){S=e.s,j=e.I},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var O={0:"待处理",1:"退货中",2:"已完成",3:"已拒绝"};e("default",r({name:"after-sale",data:function(){return{active:"0",list:[],dataShow:!1,loading:!1,finished:!1,show:!1,kmsShow:!1,params:{pageNum:1,pageSize:20},returnGood:{},reason:"",returnOrderSn:"",returnGoodId:0}},watch:{active:function(){this.init(),this.getList()}},mounted:function(){this.getList()},methods:{init:function(){this.params.pageNum=1,this.finished=!1,this.list=[]},getList:function(){var e=this;return u(regeneratorRuntime.mark((function t(){var r,n,u,a,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log(e.loading,e.finished),!e.loading||!e.finished){t.next=3;break}return t.abrupt("return");case 3:if(e.loading=!0,"0"!==e.active){t.next=10;break}return t.next=7,e.getIsReturnOrderList();case 7:u=t.sent,t.next=13;break;case 10:return t.next=12,e.getReturnList();case 12:u=t.sent;case 13:if(u&&200===u.code&&u.data.list){if(a=u.data,Array.isArray(a.list)){for(i=[],o=0;o<a.list.length;o++)a.list[o].orderItemList?a.list[o].orderItemList.findIndex((function(e){return e.returnStatus<0}))>-1&&i.push(a.list[o]):i.push(a.list[o]);e.list=e.list.concat(e.list,i)}e.params.pageNum=u.data.pageNum+1}e.finished=e.params.pageNum>=(null===(r=u)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.totalPage),e.loading=!1;case 16:case"end":return t.stop()}}),t)})))()},getIsReturnOrderList:function(){var e=this;return u(regeneratorRuntime.mark((function r(){var u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,n.get("/api-mall-portal/order/list",{params:t(t({},e.params),{},{status:"1,2,3"})});case 3:return u=r.sent,r.abrupt("return",u);case 7:r.prev=7,r.t0=r.catch(0);case 9:return r.abrupt("return",{});case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))()},getReturnList:function(){var e=this;return u(regeneratorRuntime.mark((function r(){var u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,n.post("/api-mall-portal/returnApply/list",{data:t(t({},e.params),{},{status:"1"===e.active?"0,1":"2,3"})});case 3:return u=r.sent,r.abrupt("return",u);case 7:r.prev=7,r.t0=r.catch(0);case 9:return r.abrupt("return",{});case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))()},setReturnParams:function(e,t){this.returnGood.memberUsername=a.user.data.username,this.returnGood.orderId=e.id,this.returnGood.orderSn=e.orderSn,this.returnGood.productAttr=t.productAttr,this.returnGood.productBrand=t.productBrand,this.returnGood.productCount=t.productQuantity,this.returnGood.productId=t.productId,this.returnGood.productName=t.productName,this.returnGood.productPic=t.productPic,this.returnGood.productPrice=t.productPrice,this.returnGood.productRealPrice=t.productPrice,this.returnGood.proofPics="",this.returnGood.returnName=e.receiverName,this.returnGood.returnPhone=e.receiverPhone,this.returnGood.orderItemId=t.id,console.log(this.returnGood)},setReturnShop:function(){var e=this;return u(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.reason){r.next=3;break}return i("请填写退货原因!"),r.abrupt("return");case 3:return r.prev=3,r.next=6,n.post("/api-mall-portal/returnApply/create",{data:t(t({},e.returnGood),{},{reason:e.reason})});case 6:200===r.sent.code&&(i({message:"退货申请成功",icon:"success"}),setTimeout((function(){e.show=!1,e.reason="",e.returnOrderSn="",e.active="1"}),500)),r.next=12;break;case 10:r.prev=10,r.t0=r.catch(3);case 12:e.returnGood={};case 13:case"end":return r.stop()}}),r,null,[[3,10]])})))()},setReturnApplySn:function(){var e=this;return u(regeneratorRuntime.mark((function t(){var r,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.returnOrderSn){t.next=3;break}return i("请填写退货快递单号"),t.abrupt("return");case 3:return t.prev=3,t.next=6,n.post("/api-mall-portal/returnApply/deliverySn",{data:{deliverySn:e.returnOrderSn,id:e.returnGoodId}});case 6:r=t.sent,u=r.code,r.data,200===u&&(e.returnOrderSn="",e.kmsShow=!1,e.init(),e.getList()),t.next=14;break;case 12:t.prev=12,t.t0=t.catch(3);case 14:case"end":return t.stop()}}),t,null,[[3,12]])})))()},deleteReturnApply:function(){var e=this;o.confirm({title:"提示",message:"是否撤销退货申请?",confirmButtonText:"撤销",confirmButtonColor:"var(--van-primary)"}).then(u(regeneratorRuntime.mark((function t(){var r,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.post("/api-mall-portal/returnApply/delete/"+e.returnGoodId);case 3:r=t.sent,u=r.code,r.data,200===u&&(e.init(),e.getList()),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])}))))}},render:function(){var e,t,r=this;return s("div",{class:S.shopOrder},[s(m,null,null),s(w,{active:this.active,"onUpdate:active":function(e){return r.active=e},color:"var(--van-primary)",lineWidth:28,animated:!0,swipeable:!0},(t=e=[{name:"0",title:"全部"},{name:"1",title:"处理中"},{name:"2",title:"已处理"}].map((function(e){return s(x,{name:e.name,title:e.title},{default:function(){return[r.list.length?s(b,{loading:r.loading,finished:r.finished,finishedText:" ",class:[S.goodsList],onLoad:r.getList},{default:function(){return[r.active===e.name&&r.list.map((function(e){return s(c,null,[e.orderItemList&&e.orderItemList.length?e.orderItemList.map((function(t){return s(v,{class:S.cellGroup},{default:function(){return[s(j,{item:t},null),s(g,{center:!0},{default:function(){return s("div",{class:S.btnList},["0"===r.active&&t.returnStatus<0&&(3!=e.status||0==e.afterSale)?s(l,{size:"small",round:!0,type:"primary",onClick:function(){r.show=!0,r.setReturnParams(e,t)}},{default:function(){return[d("退货申请")]}}):null,t.returnStatus>=0?s("div",null,[O[t.returnStatus]]):null])}})]}})})):s(v,{class:S.cellGroup},{default:function(){return[s(g,{title:e.createTime,titleClass:S.payTime,value:O[e.status]},null),s(j,{item:e},null),s(g,{center:!0},{default:function(){return s("div",{class:S.btnList},[1!==e.status||e.deliverySn?null:s(l,{size:"small",round:!0,onClick:function(){r.returnGoodId=e.id,r.kmsShow=!0}},{default:function(){return[d("填写退货快递单号")]}}),e.status<=1?s(l,{size:"small",round:!0,type:"primary",onClick:function(){r.returnGoodId=e.id,r.deleteReturnApply()}},{default:function(){return[d("撤销申请")]}}):null,2===e.status?s("div",{class:S.returnDes},[d("该商品金额已于 "),e.handleTime," ",d("原路退还")]):3===e.status?s("div",{class:S.returnDes},[d("拒绝原因: "),e.handleNote]):null])}})]}})])}))]}}):s(p,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无数据"},null)]}})})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?e:{default:function(){return[e]}})),s(h,{show:this.show,"onUpdate:show":function(e){return r.show=e},title:"退货原因"},{default:function(){return[s("div",{style:{paddingTop:"15px"}},[s(y,{class:[S.field],placeholder:"请输入退货原因",type:"textarea",rows:3,modelValue:r.reason,"onUpdate:modelValue":function(e){return r.reason=e}},null)]),s("div",{class:S["btn-group"]},[s(l,{type:"primary",block:!0,round:!0,onClick:function(){return r.setReturnShop()}},{default:function(){return[d("确定")]}})])]}}),s(h,{show:this.kmsShow,"onUpdate:show":function(e){return r.kmsShow=e},title:"填写退货快递单号"},{default:function(){return[s(y,{modelValue:r.returnOrderSn,"onUpdate:modelValue":function(e){return r.returnOrderSn=e},class:[S.field],placeholder:"请输入退货快递单号"},null),s("div",{class:S["btn-group"]},[s(l,{type:"primary",block:!0,round:!0,onClick:function(){return r.setReturnApplySn()}},{default:function(){return[d("确定")]}})])]}})])}}))}}}))}();