1 |
- import{E as V,ab as H,a0 as N,d as _,aj as L,j as e,at as M,W as R,ba as G,N as x,O as W,bC as k,P as Q,U as D,V as J,F as A,B,A as $,bw as K,$ as U,y as T,T as X,D as Z}from"./ResizeObserver.es.b7226882.js";import{D as j}from"./index.82175eae.js";import{C as u}from"./index.40f703b6.js";import{C as E}from"./index.9269bf1e.js";import{f as ee}from"./cart.5e5d785e.js";import"./index.20c0f4c5.js";import"./index.ed3a5560.js";import{C as te}from"./index.30f2a704.js";import{o as ae}from"./shop-mall.727de868.js";import{C as ie}from"./index.0b42adfa.js";import{C as re}from"./index.969bba7f.js";import"./index.1eaf642c.js";const[Y,F]=V("steps"),le={active:H(0),direction:N("horizontal"),activeIcon:N("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},q=Symbol(Y);var oe=_({name:Y,props:le,emits:["click-step"],setup(r,{emit:i,slots:a}){const{linkChildren:m}=L(q);return m({props:r,onClickStep:c=>i("click-step",c)}),()=>{var c;return e("div",{class:F([r.direction])},[e("div",{class:F("items")},[(c=a.default)==null?void 0:c.call(a)])])}}});const[ne,C]=V("step");var ce=_({name:ne,setup(r,{slots:i}){const{parent:a,index:m}=M(q);if(!a){console.error("[Vant] <Step> must be a child component of <Steps>.");return}const d=a.props,c=()=>{const n=+d.active;return m.value<n?"finish":m.value===n?"process":"waiting"},S=()=>c()==="process",b=R(()=>({background:c()==="finish"?d.activeColor:d.inactiveColor})),o=R(()=>{if(S())return{color:d.activeColor};if(c()==="waiting")return{color:d.inactiveColor}}),l=()=>a.onClickStep(m.value),t=()=>{const{iconPrefix:n,finishIcon:p,activeIcon:f,activeColor:y,inactiveIcon:g}=d;return S()?i["active-icon"]?i["active-icon"]():e(x,{class:C("icon","active"),name:f,color:y,classPrefix:n},null):c()==="finish"&&(p||i["finish-icon"])?i["finish-icon"]?i["finish-icon"]():e(x,{class:C("icon","finish"),name:p,color:y,classPrefix:n},null):i["inactive-icon"]?i["inactive-icon"]():g?e(x,{class:C("icon"),name:g,classPrefix:n},null):e("i",{class:C("circle"),style:b.value},null)};return()=>{var n;const p=c();return e("div",{class:[G,C([d.direction,{[p]:p}])]},[e("div",{class:C("title",{active:S()}),style:o.value,onClick:l},[(n=i.default)==null?void 0:n.call(i)]),e("div",{class:C("circle-container"),onClick:l},[t()]),e("div",{class:C("line"),style:b.value},null)])}}});const se=W(ce),ue=W(oe);const de="_item_2zuar_4";var pe={item:de},ve=_({name:"shop-item",props:{item:{type:Object,default:{productPic:"",productName:"",productAttr:"",productPrice:0,productQuantity:0}}},setup({item:r}){return()=>e(te,{class:pe.item,thumb:r.productPic,title:r.productName,desc:ee(r.productAttr),price:k(r.productPrice),num:r.productQuantity},null)}});const me="_shopOrderDetail_zncun_1",fe="_box_zncun_15",ye="_logisticsTitle_zncun_32",ge="_logisticsTime_zncun_37",Ce="_addressDetail_zncun_41",Se="_copyWrap_zncun_44";var v={shopOrderDetail:me,box:fe,logisticsTitle:ye,logisticsTime:ge,addressDetail:Ce,copyWrap:Se};function be(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!U(r)}var Ae=_({name:"shop-order-detail",setup(){const r=Q(),i=D([]),a=D({}),m=D([]),d=async()=>{const o=r.query.id;if(!!o)try{const{code:l,data:t}=await T.get(`/api-mall-portal/order/detail/${o}`);l===200&&(i.value=t.orderItemList,delete t.orderItemList,a.value=t,a.value.address_data=[t.receiverProvince,t.receiverCity,t.receiverRegion,t.receiverDetailAddress].join(""),t.deliverySn&&await S(t.deliverySn))}catch{}};J(()=>{d()});const c=o=>{var p;const l=o.toString();let t=document.querySelector("#copy-input");t||(t=document.createElement("input"),t.id="copy-input",t.readOnly=!0,t.style.position="absolute",t.style.left="-1000px",t.style.zIndex="-1000",(p=document.querySelector("#input-copy-container"))==null||p.appendChild(t)),t.value=l,n(t,0,l.length),console.log(document.execCommand("copy"),"execCommand"),document.execCommand("copy")&&(document.execCommand("copy"),X("\u590D\u5236\u6210\u529F")),t.blur();function n(f,y,g){if(f.createTextRange){const s=f.createTextRange();s.collapse(!0),s.moveStart("character",y),s.moveEnd("character",g-y),s.select()}else f.setSelectionRange(y,g),f.focus()}},S=async o=>{try{const{data:l}=await T.get("/api-mall-portal/order/selectCourier",{params:{deliverySn:o}}),t=l.logistics?JSON.parse(l.logistics):[];console.log(t),m.value=t}catch{}},b=async o=>{await Z.confirm({title:"\u63D0\u793A",message:"\u786E\u8BA4\u6536\u8D27?",confirmButtonText:"\u6536\u8D27",confirmButtonColor:"var(--van-primary)"})==="confirm"&&(await T.post("/api-mall-portal/order/confirmReceiveOrder",{params:{orderId:o.id}})).code===200&&d()};return()=>{var l,t,n,p,f,y,g;let o;return e(A,null,[e(re,null,null),i.value.length?e(A,null,[e("div",{class:v.shopOrderDetail},[e("div",{class:v.box},[i.value.map((s,h)=>e("div",null,[e(ve,{item:s},null),h===i.value.length-1?null:e(j,null,null)]))]),e("div",{class:v.box,style:{padding:0}},[e(u,{border:!1,title:"\u5546\u54C1\u4EF7\u683C\uFF1A",value:"\xA5 "+k((l=a.value)==null?void 0:l.totalAmount)},null),e(u,{border:!1,title:"\u4F18\u60E0\u4EF7\u683C\uFF1A",value:"-\xA5 "+k((t=a.value)==null?void 0:t.couponAmount)},null),e(u,{border:!1,title:"\u8BA2\u5355\u72B6\u6001\uFF1A",value:ae[(n=a.value)==null?void 0:n.status]},null),e(u,{border:!1,title:"\u6536\u8D27\u72B6\u6001\uFF1A",value:(p=a.value)!=null&&p.confirmStatus?"\u5DF2\u786E\u8BA4\u6536\u8D27":"\u672A\u786E\u8BA4\u6536\u8D27"},null),e(j,{style:{margin:0}},null),e(u,{border:!1,title:"\u8BA2\u5355\u53F7\uFF1A",value:(f=a.value)==null?void 0:f.orderSn},null),e(u,{border:!1,title:"\u521B\u5EFA\u65F6\u95F4\uFF1A",value:(y=a.value)==null?void 0:y.createTime},null),e(u,{border:!1,title:"\u4ED8\u6B3E\u65F6\u95F4\uFF1A",value:(g=a.value)==null?void 0:g.paymentTime},null)]),e("div",{class:v.box,style:{padding:0}},[e(E,{title:"\u6536\u8D27\u4FE1\u606F",border:!1},{default:()=>{var s,h,P,O;return[e(u,{border:!1,title:"\u59D3\u540D\uFF1A",value:(s=a.value)==null?void 0:s.receiverName},null),e(u,{border:!1,title:"\u624B\u673A\u53F7\uFF1A",value:(h=a.value)==null?void 0:h.receiverPhone},null),e(u,{class:v.addressDetail,border:!1,title:"\u5730\u5740\uFF1A",value:(P=a.value)==null?void 0:P.address_data},null),e(u,{class:v.addressDetail,border:!1,title:"\u7269\u6D41\u516C\u53F8(\u914D\u9001\u65B9\u5F0F):",value:(O=a.value)==null?void 0:O.deliveryCompany},null),e(u,{class:v.addressDetail,border:!1,title:"\u8FD0\u5355\u7F16\u53F7\uFF1A"},{value:()=>{var I,w;return e("div",{class:v.copyWrap},[e("span",{style:{marginRight:"8px"}},[(I=a.value)==null?void 0:I.deliverySn]),((w=a.value)==null?void 0:w.deliverySn)&&e(B,{size:"mini",onClick:he=>{var z;c((z=a.value)==null?void 0:z.deliverySn)}},{default:()=>[$("\u70B9\u51FB\u590D\u5236")]})])}})]}}),e("div",{id:"input-copy-container"},null)]),m.value.length>0&&e("div",{class:v.box,style:{padding:0}},[e(E,{title:"\u7269\u6D41\u4FE1\u606F",border:!1},{default:()=>[e(ue,{direction:"vertical",active:0,activeColor:"var(--van-primary)"},be(o=m.value.map(s=>e(se,null,{default:()=>[e("h3",{class:v.logisticsTitle},[s.context]),e("p",{class:v.logisticsTime},[K(s.time,"YYYY-MM-DD HH:mm")])]})))?o:{default:()=>[o]})]})])]),a.value.status===2&&e(ie,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(B,{block:!0,round:!0,type:"primary",onClick:()=>{b(a.value)}},{default:()=>[$("\u786E\u8BA4\u6536\u8D27")]})])]})]):null])}}});export{Ae as default};
|