"use strict";var r=require("../common/vendor.js"),c=require("../api/prescribe.js"),t=require("../api/storeOrder.js");require("../common/request.js");const p={data(){return{payLimitTime:null,orderId:null,order:{},items:[]}},onLoad(s){this.orderId=s.orderId},onShow(){this.getCompanyUserStoreOrderById()},methods:{showPrescribe(){var s={prescribeId:this.order.prescribeId};c.getPrescribeById(s).then(o=>{if(o.code==200)if(o.data.prescribe.prescribeImgUrl!=null){var i=[];i.push(o.data.prescribe.prescribeImgUrl),r.index.previewImage({current:0,urls:i})}else r.index.showToast({icon:"none",title:"\u7535\u5B50\u5904\u65B9\u5355\u4E0D\u5B58\u5728"})},o=>{})},getCompanyUserStoreOrderById(){var s={orderId:this.orderId};t.getCompanyUserStoreOrderById(s).then(o=>{o.code==200?(this.order=o.order,this.items=o.items,this.payLimitTime=o.payLimitTime,this.prescribe=o.prescribe):r.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"})})},showDelivery(){r.index.navigateTo({url:"./storeOrderDelivery?orderId="+this.orderId})},cancel(){var s=this;r.index.showModal({title:"\u63D0\u793A",content:"\u786E\u5B9A\u53D6\u6D88\u8BA2\u5355\u5417",success:function(o){if(o.confirm){var i={orderId:s.order.orderId};t.cancelOrder(i).then(d=>{d.code==200?(s.getMyStoreOrderById(),r.index.$emit("refreshStoreOrder")):r.index.showToast({icon:"none",title:d.msg})})}else o.cancel}})},finish(){var s=this;r.index.showModal({title:"\u63D0\u793A",content:"\u786E\u5B9A\u5DF2\u6536\u8D27\u5417",success:function(o){if(o.confirm){var i={orderId:s.orderId};t.finishOrder(i).then(d=>{d.code==200?(s.getMyStoreOrderById(),r.index.$emit("refreshStoreOrder")):r.index.showToast({icon:"none",title:d.msg})})}else o.cancel}})},pay(){r.index.navigateTo({url:"/pages_order/storeOrderPay?orderId="+this.order.orderId})},payRemain(){r.index.navigateTo({url:"/pages_user/user/paymentOrderRemain?orderId="+this.order.orderId})},copyOrderSn(s){r.index.setClipboardData({data:s,success:()=>{r.index.showToast({title:"\u5185\u5BB9\u5DF2\u6210\u529F\u590D\u5236\u5230\u526A\u5207\u677F",icon:"none"})}})},refund(){r.index.navigateTo({url:"/pages_order/storeOrderRefundApply?orderId="+this.orderId})}}};function y(s,o,i,d,e,l){return r.e({a:e.order.status==1},e.order.status==1?{b:r.t(e.payLimitTime)}:{},{c:e.order.status==2},e.order.status==2?{}:{},{d:e.order.status==3},e.order.status==3?{}:{},{e:e.order.status==4},e.order.status==4?{}:{},{f:e.order.status==-3},e.order.status==-3?{}:{},{g:e.order.status==-1},e.order.status==-1?{}:{},{h:e.order.status==-2},e.order.status==-2?{}:{},{i:e.order.userName!=null},e.order.userName!=null?r.e({j:r.t(e.order.userName),k:e.order.userPhone!=null},e.order.userPhone!=null?{l:r.t(e.order.userPhone)}:{},{m:r.t(e.order.userAddress)}):{},{n:r.f(e.items,(n,u,h)=>r.e({a:JSON.parse(n.jsonInfo).image==""?"/static/images/drug.svg":JSON.parse(n.jsonInfo).image,b:r.t(JSON.parse(n.jsonInfo).productName),c:r.t(JSON.parse(n.jsonInfo).sku)},e.order.ordetType==1?{d:r.t(JSON.parse(n.jsonInfo).num)}:{},{e:u})),o:e.order.ordetType==1,p:r.t(e.order.payPrice),q:r.t(e.order.orderCode),r:r.o(n=>l.copyOrderSn(e.order.orderCode)),s:r.t(e.order.createTime),t:e.order.payType==1},e.order.payType==1?{}:{},{v:e.order.payType==2},e.order.payType==2?{}:{},{w:e.order.totalPrice!=null},e.order.totalPrice!=null?{x:r.t(e.order.totalPrice.toFixed(2))}:{},{y:e.order.discountMoney!=null},e.order.discountMoney!=null?{z:r.t(e.order.discountMoney.toFixed(2))}:{},{A:e.order.payPrice!=null},e.order.payPrice!=null?{B:r.t(e.order.payPrice.toFixed(2))}:{},{C:e.order.payMoney!=null},e.order.payMoney!=null?{D:r.t(e.order.payMoney.toFixed(2))}:{},{E:e.order.payTime!=null},e.order.payTime!=null?{F:r.t(e.order.payTime)}:{},{G:e.order.deliverySn!=null},e.order.deliverySn!=null?{H:r.o(n=>l.showDelivery())}:{})}var m=r._export_sfc(p,[["render",y],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_company/storeOrderDetail.vue"]]);wx.createPage(m);
