index.806d71dc.js 7.2 KB

1
  1. import{A as V,aa as W,$ as N,d as _,ai as L,j as e,as as G,V as R,b4 as H,M as x,N as Y,by as k,O as Q,S as D,U as J,F as A,B,z as $,br as K,Z as U,w as T,T as Z,D as X}from"./index.e6d6174e.js";import{D as j}from"./index.ff9da48e.js";import{C as u}from"./index.af99cf22.js";import{C as E}from"./index.4aea64de.js";import{f as ee}from"./cart.a845ff4e.js";import"./index.67c54471.js";import"./index.05f2b7dd.js";import{C as te}from"./index.0ed5cae2.js";import{o as ie}from"./shop-mall.60cd47e3.js";import{C as ae}from"./index.b0eda115.js";const[q,F]=V("steps"),re={active:W(0),direction:N("horizontal"),activeIcon:N("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},M=Symbol(q);var le=_({name:q,props:re,emits:["click-step"],setup(r,{emit:a,slots:i}){const{linkChildren:m}=L(M);return m({props:r,onClickStep:c=>a("click-step",c)}),()=>{var c;return e("div",{class:F([r.direction])},[e("div",{class:F("items")},[(c=i.default)==null?void 0:c.call(i)])])}}});const[oe,S]=V("step");var ne=_({name:oe,setup(r,{slots:a}){const{parent:i,index:m}=G(M);if(!i){console.error("[Vant] <Step> must be a child component of <Steps>.");return}const d=i.props,c=()=>{const n=+d.active;return m.value<n?"finish":m.value===n?"process":"waiting"},C=()=>c()==="process",b=R(()=>({background:c()==="finish"?d.activeColor:d.inactiveColor})),o=R(()=>{if(C())return{color:d.activeColor};if(c()==="waiting")return{color:d.inactiveColor}}),l=()=>i.onClickStep(m.value),t=()=>{const{iconPrefix:n,finishIcon:p,activeIcon:f,activeColor:y,inactiveIcon:g}=d;return C()?a["active-icon"]?a["active-icon"]():e(x,{class:S("icon","active"),name:f,color:y,classPrefix:n},null):c()==="finish"&&(p||a["finish-icon"])?a["finish-icon"]?a["finish-icon"]():e(x,{class:S("icon","finish"),name:p,color:y,classPrefix:n},null):a["inactive-icon"]?a["inactive-icon"]():g?e(x,{class:S("icon"),name:g,classPrefix:n},null):e("i",{class:S("circle"),style:b.value},null)};return()=>{var n;const p=c();return e("div",{class:[H,S([d.direction,{[p]:p}])]},[e("div",{class:S("title",{active:C()}),style:o.value,onClick:l},[(n=a.default)==null?void 0:n.call(a)]),e("div",{class:S("circle-container"),onClick:l},[t()]),e("div",{class:S("line"),style:b.value},null)])}}});const ce=Y(ne),se=Y(le);const ue="_item_2zuar_4";var de={item:ue},pe=_({name:"shop-item",props:{item:{type:Object,default:{productPic:"",productName:"",productAttr:"",productPrice:0,productQuantity:0}}},setup({item:r}){return()=>e(te,{class:de.item,thumb:r.productPic,title:r.productName,desc:ee(r.productAttr),price:k(r.productPrice),num:r.productQuantity},null)}});const ve="_shopOrderDetail_zncun_1",me="_box_zncun_15",fe="_logisticsTitle_zncun_32",ye="_logisticsTime_zncun_37",ge="_addressDetail_zncun_41",Se="_copyWrap_zncun_44";var v={shopOrderDetail:ve,box:me,logisticsTitle:fe,logisticsTime:ye,addressDetail:ge,copyWrap:Se};function Ce(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!U(r)}var we=_({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 C(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"),Z("\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()}},C=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,[a.value.length?e(A,null,[e("div",{class:v.shopOrderDetail},[e("div",{class:v.box},[a.value.map((s,h)=>e("div",null,[e(pe,{item:s},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 s,h,P,O;return[e(u,{border:!1,title:"\u59D3\u540D\uFF1A",value:(s=i.value)==null?void 0:s.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:be=>{var w;c((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(se,{direction:"vertical",active:0,activeColor:"var(--van-primary)"},Ce(o=m.value.map(s=>e(ce,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]})]})])]),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{we as default};