index.dcbee703.js 7.2 KB

1
  1. import{A as V,aa as W,$ as N,d as _,ai as H,j as e,as as L,V as R,b4 as G,M as x,N as Y,bz as k,O as Q,S as D,U as J,F as A,B,z as $,bs as K,Z as U,w as T,T as Z,D as X}from"./index.394decd7.js";import{D as j}from"./index.d425b040.js";import{C as u}from"./index.9e0d46e4.js";import{C as E}from"./index.9462d7c5.js";import{f as ee}from"./cart.3ddc848e.js";import"./index.ae2dd816.js";import"./index.dab716ce.js";import{C as te}from"./index.07bd1663.js";import{o as ie}from"./shop-mall.61aa9572.js";import{C as ae}from"./index.45d094fa.js";import{C as re}from"./index.e6e212d8.js";const[q,F]=V("steps"),le={active:W(0),direction:N("horizontal"),activeIcon:N("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},M=Symbol(q);var oe=_({name:q,props:le,emits:["click-step"],setup(r,{emit:a,slots:i}){const{linkChildren:m}=H(M);return m({props:r,onClickStep:s=>a("click-step",s)}),()=>{var s;return e("div",{class:F([r.direction])},[e("div",{class:F("items")},[(s=i.default)==null?void 0:s.call(i)])])}}});const[ne,C]=V("step");var se=_({name:ne,setup(r,{slots:a}){const{parent:i,index:m}=L(M);if(!i){console.error("[Vant] <Step> must be a child component of <Steps>.");return}const d=i.props,s=()=>{const n=+d.active;return m.value<n?"finish":m.value===n?"process":"waiting"},S=()=>s()==="process",b=R(()=>({background:s()==="finish"?d.activeColor:d.inactiveColor})),o=R(()=>{if(S())return{color:d.activeColor};if(s()==="waiting")return{color:d.inactiveColor}}),l=()=>i.onClickStep(m.value),t=()=>{const{iconPrefix:n,finishIcon:p,activeIcon:f,activeColor:y,inactiveIcon:g}=d;return S()?a["active-icon"]?a["active-icon"]():e(x,{class:C("icon","active"),name:f,color:y,classPrefix:n},null):s()==="finish"&&(p||a["finish-icon"])?a["finish-icon"]?a["finish-icon"]():e(x,{class:C("icon","finish"),name:p,color:y,classPrefix:n},null):a["inactive-icon"]?a["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=s();return e("div",{class:[G,C([d.direction,{[p]:p}])]},[e("div",{class:C("title",{active:S()}),style:o.value,onClick:l},[(n=a.default)==null?void 0:n.call(a)]),e("div",{class:C("circle-container"),onClick:l},[t()]),e("div",{class:C("line"),style:b.value},null)])}}});const ce=Y(se),ue=Y(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 Re=_({name:"shop-order-detail",setup(){const r=Q(),a=D([]),i=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&&(a.value=t.orderItemList,delete t.orderItemList,i.value=t,i.value.address_data=[t.receiverProvince,t.receiverCity,t.receiverRegion,t.receiverDetailAddress].join(""),t.deliverySn&&await S(t.deliverySn))}catch{}};J(()=>{d()});const s=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"),Z("\u590D\u5236\u6210\u529F")),t.blur();function n(f,y,g){if(f.createTextRange){const c=f.createTextRange();c.collapse(!0),c.moveStart("character",y),c.moveEnd("character",g-y),c.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 X.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),a.value.length?e(A,null,[e("div",{class:v.shopOrderDetail},[e("div",{class:v.box},[a.value.map((c,h)=>e("div",null,[e(ve,{item:c},null),h===a.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=i.value)==null?void 0:l.totalAmount)},null),e(u,{border:!1,title:"\u4F18\u60E0\u4EF7\u683C\uFF1A",value:"-\xA5 "+k((t=i.value)==null?void 0:t.couponAmount)},null),e(u,{border:!1,title:"\u8BA2\u5355\u72B6\u6001\uFF1A",value:ie[(n=i.value)==null?void 0:n.status]},null),e(u,{border:!1,title:"\u6536\u8D27\u72B6\u6001\uFF1A",value:(p=i.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=i.value)==null?void 0:f.orderSn},null),e(u,{border:!1,title:"\u521B\u5EFA\u65F6\u95F4\uFF1A",value:(y=i.value)==null?void 0:y.createTime},null),e(u,{border:!1,title:"\u4ED8\u6B3E\u65F6\u95F4\uFF1A",value:(g=i.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 c,h,P,O;return[e(u,{border:!1,title:"\u59D3\u540D\uFF1A",value:(c=i.value)==null?void 0:c.receiverName},null),e(u,{border:!1,title:"\u624B\u673A\u53F7\uFF1A",value:(h=i.value)==null?void 0:h.receiverPhone},null),e(u,{class:v.addressDetail,border:!1,title:"\u5730\u5740\uFF1A",value:(P=i.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=i.value)==null?void 0:O.deliveryCompany},null),e(u,{class:v.addressDetail,border:!1,title:"\u8FD0\u5355\u7F16\u53F7\uFF1A"},{value:()=>{var z,I;return e("div",{class:v.copyWrap},[e("span",{style:{marginRight:"8px"}},[(z=i.value)==null?void 0:z.deliverySn]),((I=i.value)==null?void 0:I.deliverySn)&&e(B,{size:"mini",onClick:he=>{var w;s((w=i.value)==null?void 0:w.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(c=>e(ce,null,{default:()=>[e("h3",{class:v.logisticsTitle},[c.context]),e("p",{class:v.logisticsTime},[K(c.time,"YYYY-MM-DD HH:mm")])]})))?o:{default:()=>[o]})]})])]),i.value.status===2&&e(ae,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(B,{block:!0,round:!0,type:"primary",onClick:()=>{b(i.value)}},{default:()=>[$("\u786E\u8BA4\u6536\u8D27")]})])]})]):null])}}});export{Re as default};