index.a0539d85.js 7.3 KB

1
  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,bb as G,N as x,O as W,bA as k,P as Q,U as D,V as J,F as w,B,A as $,bt as K,$ as U,y as T,T as X,D as Z}from"./ResizeObserver.es.f28023e0.js";import{D as j}from"./index.8cf69176.js";import{C as u}from"./index.3b2e70c8.js";import{C as E}from"./index.2a22730e.js";import{f as ee}from"./cart.6c277712.js";import"./index.7a1af785.js";import"./index.af901340.js";import{C as te}from"./index.e3e7bc2c.js";import{o as ie}from"./shop-mall.6ab98b7b.js";import{C as ae}from"./index.8c937010.js";import{C as re}from"./index.bd375ca9.js";import"./index.9a41251d.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:a,slots:i}){const{linkChildren:m}=L(q);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[ne,C]=V("step");var ce=_({name:ne,setup(r,{slots:a}){const{parent:i,index:m}=M(q);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"},b=()=>c()==="process",S=R(()=>({background:c()==="finish"?d.activeColor:d.inactiveColor})),o=R(()=>{if(b())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 b()?a["active-icon"]?a["active-icon"]():e(x,{class:C("icon","active"),name:f,color:y,classPrefix:n},null):c()==="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:S.value},null)};return()=>{var n;const p=c();return e("div",{class:[G,C([d.direction,{[p]:p}])]},[e("div",{class:C("title",{active:b()}),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:S.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",be="_copyWrap_zncun_44";var v={shopOrderDetail:me,box:fe,logisticsTitle:ye,logisticsTime:ge,addressDetail:Ce,copyWrap:be};function Se(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 b(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()}},b=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{}},S=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(w,null,[e(re,null,null),a.value.length?e(w,null,[e("div",{class:v.shopOrderDetail},[e("div",{class:v.box},[a.value.map((s,h)=>e("div",null,[e(ve,{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 I,z;return e("div",{class:v.copyWrap},[e("span",{style:{marginRight:"8px"}},[(I=i.value)==null?void 0:I.deliverySn]),((z=i.value)==null?void 0:z.deliverySn)&&e(B,{size:"mini",onClick:he=>{var A;c((A=i.value)==null?void 0:A.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)"},Se(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]})]})])]),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:()=>{S(i.value)}},{default:()=>[$("\u786E\u8BA4\u6536\u8D27")]})])]})]):null])}}});export{we as default};