"use strict";var s=require("../common/vendor.js"),e=require("../api/common.js"),t=require("../api/storeAfterSales.js");require("../common/request.js");const a={data:()=>({statusOptions:[],sales:{},items:[],order:null,salesId:null,statusBarHeight:s.index.getStorageSync("menuInfo").statusBarHeight}),onLoad(s){this.id=s.id},onShow(){this.getStoreAfterSalesById(),this.getDictByKey("sys_after_sales_status")},methods:{getDictByKey(s){var t={key:s};e.getDictByKey(t).then((e=>{200==e.code&&"sys_after_sales_status"==s&&(this.statusOptions=e.data)}),(s=>{}))},addDeliverySn(){s.index.navigateTo({url:"./storeOrderRefundAddDelivery?id="+this.id})},revoke(){var e={id:this.id};t.revoke(e).then((e=>{200==e.code?(s.index.showToast({icon:"success",title:"操作成功"}),setTimeout((function(){s.index.$emit("refreshAfterSales"),s.index.navigateBack({delta:1})}),500)):s.index.showToast({icon:"none",title:e.msg})}))},getStoreAfterSalesById(){var e={id:this.id};t.getStoreAfterSalesById(e).then((e=>{200==e.code?(this.sales=e.sales,this.items=e.items,this.order=e.order):s.index.showToast({icon:"none",title:e.msg})}))},showLogs(e){s.index.navigateTo({url:"./refundOrderLogs?orderStatus="+e})}}};var l=s._export_sfc(a,[["render",function(e,t,a,l,r,n){return s.e({a:0==r.sales.salesStatus},(r.sales.salesStatus,{}),{b:1==r.sales.salesStatus},(r.sales.salesStatus,{}),{c:2==r.sales.salesStatus},(r.sales.salesStatus,{}),{d:3==r.sales.salesStatus},(r.sales.salesStatus,{}),{e:null!=r.sales.refundAmount},null!=r.sales.refundAmount?{f:s.t(r.sales.refundAmount.toFixed(2))}:{},{g:s.t(e.$getDictLabelName(r.statusOptions,r.sales.salesStatus)),h:r.sales.status>=1&&1==r.sales.refundType},r.sales.status>=1&&1==r.sales.refundType?{i:s.t(r.sales.consignee),j:s.t(r.sales.address),k:s.t(r.sales.phoneNumber)}:{},{l:0==r.sales.salesStatus},0==r.sales.salesStatus?s.e({m:1==r.sales.status},1==r.sales.status?{n:s.o((s=>n.addDeliverySn()))}:{},{o:0==r.sales.status||1==r.sales.status},0==r.sales.status||1==r.sales.status?{p:s.o((s=>n.revoke()))}:{}):{},{q:0==r.sales.status},(r.sales.status,{}),{r:1==r.sales.status},(r.sales.status,{}),{s:2==r.sales.status},(r.sales.status,{}),{t:3==r.sales.status},(r.sales.status,{}),{v:4==r.sales.status},(r.sales.status,{}),{w:null!=r.sales},null!=r.sales?{x:s.f(r.items,((e,t,a)=>({a:""==JSON.parse(e.jsonInfo).image?"/static/images/drug.svg":JSON.parse(e.jsonInfo).image,b:s.t(JSON.parse(e.jsonInfo).productName),c:s.t(JSON.parse(e.jsonInfo).sku),d:s.t(JSON.parse(e.jsonInfo).price.toFixed(2)),e:s.t(JSON.parse(e.jsonInfo).num),f:t})))}:{},{y:s.t(r.sales.reasons),z:s.t(r.sales.explains),A:null!=r.sales.refundAmount},null!=r.sales.refundAmount?{B:s.t(r.sales.refundAmount.toFixed(2))}:{},{C:s.t(r.order.orderCode),D:s.t(r.sales.createTime)})}]]);wx.createPage(l);
