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