import{d as O,M as s,a8 as k,a6 as w,b as e,a3 as F,m as M,p as R,a0 as H,j,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 D}from"./cart.2a3b730f.js";import{s as r}from"./index.module.3bc378ff.js";import{A as G}from"./index.e7c25db6.js";import{m as P,C as Q,r as $}from"./index.b8b9219f.js";import{C as z,P as E}from"./index.c3eb7a0c.js";import{C as J}from"./index.4cc32b24.js";/* empty css *//* empty css *//* empty css */var ue=O({name:"cartConfirmAgin",setup(){var m,p,f,v,x,b,y,A,C,g,h,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:(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:(C=o.orderInfo)==null?void 0:C.receiverPhone,postCode:(g=o.orderInfo)==null?void 0:g.receiverPostCode,province:(h=o.orderInfo)==null?void 0:h.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){q("\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(U,null,[e(J,null,null),n.length?e("div",{class:r.cartConfirm},[e("div",{class:r.cartConfirmBox},[e(G,{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:D(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(H,{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(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:c.value,paymentType:"goodsPay",onBackOut:()=>a.value=!1},null)]})]):e(Q,{buttonText:"\u53BB\u8D2D\u7269\u8F66",onClick:()=>{T.push({path:"/cart"})}},null)])}});export{ue as default};