"use strict";var e=require("../common/vendor.js"),r=require("../api/prescribe.js"),o=require("../api/storeOrder.js");require("../common/request.js");const d={data:()=>({payLimitTime:null,orderId:null,order:{},items:[]}),onLoad(e){this.orderId=e.orderId},onShow(){this.getCompanyUserStoreOrderById()},methods:{showPrescribe(){var o={prescribeId:this.order.prescribeId};r.getPrescribeById(o).then((r=>{if(200==r.code)if(null!=r.data.prescribe.prescribeImgUrl){var o=[];o.push(r.data.prescribe.prescribeImgUrl),e.index.previewImage({current:0,urls:o})}else e.index.showToast({icon:"none",title:"电子处方单不存在"})}),(e=>{}))},getCompanyUserStoreOrderById(){var r={orderId:this.orderId};o.getCompanyUserStoreOrderById(r).then((r=>{200==r.code?(this.order=r.order,this.items=r.items,this.payLimitTime=r.payLimitTime,this.prescribe=r.prescribe):e.index.showToast({icon:"none",title:"请求失败"})}))},showDelivery(){e.index.navigateTo({url:"./storeOrderDelivery?orderId="+this.orderId})},cancel(){var r=this;e.index.showModal({title:"提示",content:"确定取消订单吗",success:function(d){if(d.confirm){var t={orderId:r.order.orderId};o.cancelOrder(t).then((o=>{200==o.code?(r.getMyStoreOrderById(),e.index.$emit("refreshStoreOrder")):e.index.showToast({icon:"none",title:o.msg})}))}else d.cancel}})},finish(){var r=this;e.index.showModal({title:"提示",content:"确定已收货吗",success:function(d){if(d.confirm){var t={orderId:r.orderId};o.finishOrder(t).then((o=>{200==o.code?(r.getMyStoreOrderById(),e.index.$emit("refreshStoreOrder")):e.index.showToast({icon:"none",title:o.msg})}))}else d.cancel}})},pay(){e.index.navigateTo({url:"/pages_order/storeOrderPay?orderId="+this.order.orderId})},payRemain(){e.index.navigateTo({url:"/pages_user/user/paymentOrderRemain?orderId="+this.order.orderId})},copyOrderSn(r){e.index.setClipboardData({data:r,success:()=>{e.index.showToast({title:"内容已成功复制到剪切板",icon:"none"})}})},refund(){e.index.navigateTo({url:"/pages_order/storeOrderRefundApply?orderId="+this.orderId})}}};var t=e._export_sfc(d,[["render",function(r,o,d,t,s,i){return e.e({a:1==s.order.status},1==s.order.status?{b:e.t(s.payLimitTime)}:{},{c:2==s.order.status},(s.order.status,{}),{d:3==s.order.status},(s.order.status,{}),{e:4==s.order.status},(s.order.status,{}),{f:-3==s.order.status},(s.order.status,{}),{g:-1==s.order.status},(s.order.status,{}),{h:-2==s.order.status},(s.order.status,{}),{i:null!=s.order.userName},null!=s.order.userName?e.e({j:e.t(s.order.userName),k:null!=s.order.userPhone},null!=s.order.userPhone?{l:e.t(s.order.userPhone)}:{},{m:e.t(s.order.userAddress)}):{},{n:e.f(s.items,((r,o,d)=>e.e({a:""==JSON.parse(r.jsonInfo).image?"/static/images/drug.svg":JSON.parse(r.jsonInfo).image,b:e.t(JSON.parse(r.jsonInfo).productName),c:e.t(JSON.parse(r.jsonInfo).sku)},1==s.order.ordetType?{d:e.t(JSON.parse(r.jsonInfo).num)}:{},{e:o}))),o:1==s.order.ordetType,p:e.t(s.order.payPrice),q:e.t(s.order.orderCode),r:e.o((e=>i.copyOrderSn(s.order.orderCode))),s:e.t(s.order.createTime),t:1==s.order.payType},(s.order.payType,{}),{v:2==s.order.payType},(s.order.payType,{}),{w:null!=s.order.totalPrice},null!=s.order.totalPrice?{x:e.t(s.order.totalPrice.toFixed(2))}:{},{y:null!=s.order.discountMoney},null!=s.order.discountMoney?{z:e.t(s.order.discountMoney.toFixed(2))}:{},{A:null!=s.order.payPrice},null!=s.order.payPrice?{B:e.t(s.order.payPrice.toFixed(2))}:{},{C:null!=s.order.payMoney},null!=s.order.payMoney?{D:e.t(s.order.payMoney.toFixed(2))}:{},{E:null!=s.order.payTime},null!=s.order.payTime?{F:e.t(s.order.payTime)}:{},{G:null!=s.order.deliverySn},null!=s.order.deliverySn?{H:e.o((e=>i.showDelivery()))}:{})}]]);wx.createPage(t);
