import{d as O,M as s,a6 as k,a7 as w,b as e,a3 as F,m as M,p as R,a0 as L,j,P as U,F as q,T as D}from"./vendor.27e15f5e.js";/* empty css               *//* empty css               *//* empty css                *//* empty css               *//* empty css              *//* empty css                */import{c as o,f as G}from"./cart.9f734fbb.js";import{s as r}from"./index.module.3bc378ff.js";import{A as H}from"./index.73cde4a1.js";import{m as P,C as Q,r as $}from"./index.aa5e2480.js";import{C as z,P as E}from"./index.0f2c0804.js";/* empty css               *//* empty css               */import"./index.f720c953.js";/* empty css               */var de=O({name:"cartConfirmAgin",setup(){var m,p,f,v,x,y,A,g,h,b,C,I;const n=((m=o.orderInfo)==null?void 0:m.orderItemList)||[],d={totalAmount:((p=o.orderInfo)==null?void 0:p.totalAmount)||0,payAmount:((f=o.orderInfo)==null?void 0:f.payAmount)||0,freightAmount:((v=o.orderInfo)==null?void 0:v.freightAmount)||0,couponAmount:(x=o.orderInfo)==null?void 0:x.couponAmount};s(0);const B={city:(y=o.orderInfo)==null?void 0:y.receiverCity,detailAddress:(A=o.orderInfo)==null?void 0:A.receiverDetailAddress,name:(g=o.orderInfo)==null?void 0:g.receiverName,phoneNumber:(h=o.orderInfo)==null?void 0:h.receiverPhone,postCode:(b=o.orderInfo)==null?void 0:b.receiverPostCode,province:(C=o.orderInfo)==null?void 0:C.receiverProvince,region:(I=o.orderInfo)==null?void 0:I.receiverRegion},l=s(!1),a=s(!1),u=s(!1),c=s();k(u,(t,i)=>{u.value?postMessage({api:"setBarStatus",content:{status:0}}):postMessage({api:"setBarStatus",content:{status:1}})});const S=()=>{if(!l.value){D("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u4EA7\u54C1\u53CA\u670D\u52A1\u534F\u8BAE\u300B");return}V()},T=w(),V=async()=>{console.log(o);const t={orderNo:o.orderInfo.orderSn};try{const{code:i,data:N}=await $.post("/api-mall-portal/order/generateOrder",{data:t});i===200&&(a.value=!0,c.value=N)}catch{}};return()=>e(q,null,[n.length?e("div",{class:r.cartConfirm},[e("div",{class:r.cartConfirmBox},[e(H,{item:B,isLink:!1},null)]),e("div",{style:{marginTop:"20px"},class:[r.cartBox,r.cartConfirmBox]},[e("div",{class:r.shopBox},[n.map(t=>e("div",{class:[r.cartItem],style:{marginBottom:"10px"}},[e(F,{price:P(t.productPrice),desc:G(t.productAttr),title:t.productName,thumb:t.productPic,num:t.productQuantity},null)]))]),e(M,{border:!0},{default:()=>[e(R,{border:!1,title:"\u603B\u989D",value:"\xA5 "+d.totalAmount},null)]})]),e("div",{class:r.payProtocol},[e(z,{modelValue:l.value,"onUpdate:modelValue":t=>l.value=t},null),e(L,{buttonText:`\u7ED3\u7B97(${n.length})`,buttonColor:"var(--van-primary)",disabled:n.length===0,onSubmit:()=>S()},{default:()=>[e("div",{class:r.confirmBottom},[j("\u5408\u8BA1")," ",e("span",{class:r["price-des"]},[j("\xA5"),P(d.payAmount)])])]})]),e("div",{style:{height:"var(--van-submit-bar-height)"}},null),e(U,{show:a.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[e(E,{modelValue:a.value,"onUpdate:modelValue":t=>a.value=t,orderInfo:c.value,paymentType:"goodsPay",onBackOut:()=>a.value=!1},null)]})]):e(Q,{buttonText:"\u53BB\u8D2D\u7269\u8F66",onClick:()=>{T.push({path:"/cart"})}},null)])}});export{de as default};
