!function(){function e(e,n,t,r,i,a,o){try{var l=e[a](o),c=l.value}catch(s){return void t(s)}l.done?n(c):Promise.resolve(c).then(r,i)}function n(n){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=n.apply(t,r);function l(n){e(o,i,a,l,c,"next",n)}function c(n){e(o,i,a,l,c,"throw",n)}l(void 0)}))}}function t(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,i,a=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(a.push(r.value),!n||a.length!==n);o=!0);}catch(c){l=!0,i=c}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return a}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t must be a child component of .")}}),Q=p(W),U=p(q),V="_item_2zuar_4",$=o({name:"shop-item",props:{item:{type:Object,default:{productPic:"",productName:"",productAttr:"",productPrice:0,productQuantity:0}}},setup:function(e){var n=e.item;return function(){return c(A,{class:V,thumb:n.productPic,title:n.productName,desc:P(n.productAttr),price:f(n.productPrice),num:n.productQuantity},null)}}}),F="_shopOrderDetail_zncun_1",G="_box_zncun_15",J="_logisticsTitle_zncun_32",K="_logisticsTime_zncun_37",X="_addressDetail_zncun_41",Z="_copyWrap_zncun_44";e("default",o({name:"shop-order-detail",setup:function(){var e=m(),t=_([]),r=_({}),i=_([]),a=function(){var i=n(regeneratorRuntime.mark((function n(){var i,a,l,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=e.query.id){n.next=3;break}return n.abrupt("return");case 3:return n.prev=3,n.next=6,k.get("/api-mall-portal/order/detail/".concat(i));case 6:if(a=n.sent,l=a.code,c=a.data,200!==l){n.next=17;break}if(t.value=c.orderItemList,delete c.orderItemList,r.value=c,r.value.address_data=[c.receiverProvince,c.receiverCity,c.receiverRegion,c.receiverDetailAddress].join(""),!c.deliverySn){n.next=17;break}return n.next=17,o(c.deliverySn);case 17:n.next=21;break;case 19:n.prev=19,n.t0=n.catch(3);case 21:case"end":return n.stop()}}),n,null,[[3,19]])})));return function(){return i.apply(this,arguments)}}();h((function(){a()}));var o=function(){var e=n(regeneratorRuntime.mark((function e(n){var t,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,k.get("/api-mall-portal/order/selectCourier",{params:{deliverySn:n}});case 3:t=e.sent,r=t.data,a=r.logistics?JSON.parse(r.logistics):[],console.log(a),i.value=a,e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}(),l=function(){var e=n(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C.confirm({title:"提示",message:"确认收货?",confirmButtonText:"收货",confirmButtonColor:"var(--van-primary)"});case 2:if("confirm"!==e.sent){e.next=8;break}return e.next=6,k.post("/api-mall-portal/order/confirmReceiveOrder",{params:{orderId:n.id}});case 6:200===e.sent.code&&a();case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return function(){var e,n,a,o,s,u,v,d;return c(g,null,[c(T,null,null),t.value.length?c(g,null,[c("div",{class:F},[c("div",{class:G},[t.value.map((function(e,n){return c("div",null,[c($,{item:e},null),n===t.value.length-1?null:c(S,null,null)])}))]),c("div",{class:G,style:{padding:0}},[c(j,{border:!1,title:"商品价格:",value:"¥ "+f(null===(e=r.value)||void 0===e?void 0:e.totalAmount)},null),c(j,{border:!1,title:"优惠价格:",value:"-¥ "+f(null===(n=r.value)||void 0===n?void 0:n.couponAmount)},null),c(j,{border:!1,title:"订单状态:",value:I[null===(a=r.value)||void 0===a?void 0:a.status]},null),c(j,{border:!1,title:"收货状态:",value:null!==(o=r.value)&&void 0!==o&&o.confirmStatus?"已确认收货":"未确认收货"},null),c(S,{style:{margin:0}},null),c(j,{border:!1,title:"订单号:",value:null===(s=r.value)||void 0===s?void 0:s.orderSn},null),c(j,{border:!1,title:"创建时间:",value:null===(u=r.value)||void 0===u?void 0:u.createTime},null),c(j,{border:!1,title:"付款时间:",value:null===(v=r.value)||void 0===v?void 0:v.paymentTime},null)]),c("div",{class:G,style:{padding:0}},[c(O,{title:"收货信息",border:!1},{default:function(){var e,n,t,i;return[c(j,{border:!1,title:"姓名:",value:null===(e=r.value)||void 0===e?void 0:e.receiverName},null),c(j,{border:!1,title:"手机号:",value:null===(n=r.value)||void 0===n?void 0:n.receiverPhone},null),c(j,{class:X,border:!1,title:"地址:",value:null===(t=r.value)||void 0===t?void 0:t.address_data},null),c(j,{class:X,border:!1,title:"物流公司(配送方式):",value:null===(i=r.value)||void 0===i?void 0:i.deliveryCompany},null),c(j,{class:X,border:!1,title:"运单编号:"},{value:function(){var e,n;return c("div",{class:Z},[c("span",{style:{marginRight:"8px"}},[null===(e=r.value)||void 0===e?void 0:e.deliverySn]),(null===(n=r.value)||void 0===n?void 0:n.deliverySn)&&c(b,{size:"mini",onClick:function(e){var n,t,i,a,o;t=null===(n=r.value)||void 0===n?void 0:n.deliverySn,a=t.toString(),(o=document.querySelector("#copy-input"))||((o=document.createElement("input")).id="copy-input",o.readOnly=!0,o.style.position="absolute",o.style.left="-1000px",o.style.zIndex="-1000",null===(i=document.querySelector("#input-copy-container"))||void 0===i||i.appendChild(o)),o.value=a,function(e,n,t){if(e.createTextRange){var r=e.createTextRange();r.collapse(!0),r.moveStart("character",n),r.moveEnd("character",t-n),r.select()}else e.setSelectionRange(n,t),e.focus()}(o,0,a.length),console.log(document.execCommand("copy"),"execCommand"),document.execCommand("copy")&&(document.execCommand("copy"),w("复制成功")),o.blur()}},{default:function(){return[y("点击复制")]}})])}})]}}),c("div",{id:"input-copy-container"},null)]),i.value.length>0&&c("div",{class:G,style:{padding:0}},[c(O,{title:"物流信息",border:!1},{default:function(){return[c(U,{direction:"vertical",active:0,activeColor:"var(--van-primary)"},(e=d=i.value.map((function(e){return c(Q,null,{default:function(){return[c("h3",{class:J},[e.context]),c("p",{class:K},[x(e.time,"YYYY-MM-DD HH:mm")])]}})})),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!z(e)?d:{default:function(){return[d]}}))];var e}})])]),2===r.value.status&&c(R,{position:"bottom",background:"white"},{default:function(){return[c("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[c(b,{block:!0,round:!0,type:"primary",onClick:function(){l(r.value)}},{default:function(){return[y("确认收货")]}})])]}})]):null])}}}))}}}))}();