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