import{d as U,V as i,h as k,U as O,a2 as F,a as e,as as R,C as q,q as w,aq as L,j as P,P as M,F as _,T as B}from"./vendor.a0144ce9.js";/* empty css               *//* empty css                *//* empty css                *//* empty css               *//* empty css              *//* empty css                */import{c as t,f as D}from"./cart.70a33c1b.js";import{s as r}from"./index.module.0e920025.js";import{A as G}from"./index.e53273a4.js";import{C as H}from"./index.d3777075.js";import{P as Q}from"./index.b46f9326.js";import{m as S,C as $,s as z}from"./index.3d95a92c.js";import{C as E}from"./index.e761f805.js";import{U as J}from"./index.f4e8cdea.js";import"./icon-address.5833d084.js";/* empty css                *//* empty css                */import"./icon_checkbox_default.2fe5d57e.js";import"./index.fc7d34d1.js";/* empty css               *//* empty css               */import"./orderStatus.243cb96a.js";import"./index.339fc024.js";import"./index.5a88d81f.js";/* empty css              *//* empty css               */var ge=U({name:"cartConfirmAgin",setup(){var c,p,f,v,x,j,h,C,A,y,b,g,I;const n=((c=t.orderInfo)==null?void 0:c.orderItemList)||[],l={totalAmount:((p=t.orderInfo)==null?void 0:p.totalAmount)||0,payAmount:((f=t.orderInfo)==null?void 0:f.payAmount)||0,freightAmount:((v=t.orderInfo)==null?void 0:v.freightAmount)||0};i(0);const V={city:(x=t.orderInfo)==null?void 0:x.receiverCity,detailAddress:(j=t.orderInfo)==null?void 0:j.receiverDetailAddress,name:(h=t.orderInfo)==null?void 0:h.receiverName,phoneNumber:(C=t.orderInfo)==null?void 0:C.receiverPhone,postCode:(A=t.orderInfo)==null?void 0:A.receiverPostCode,province:(y=t.orderInfo)==null?void 0:y.receiverProvince,region:(b=t.orderInfo)==null?void 0:b.receiverRegion},d=i(!1),s=i(!1),a=i(!1),u=k({orderNo:((g=t.orderInfo)==null?void 0:g.orderSn)||"",actualPrice:((I=t.orderInfo)==null?void 0:I.payAmount)||0});O(a,(o,K)=>{a.value?postMessage({api:"setBarStatus",content:{status:0}}):postMessage({api:"setBarStatus",content:{status:1}})});const m=()=>{if(!d.value){B("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u9177\u4E50\u79C0\u5E73\u53F0\u670D\u52A1\u534F\u8BAE\u300B");return}const o=z.user.data;if(!(o==null?void 0:o.realName)||!(o==null?void 0:o.idCardNo)){a.value=!0;return}if(u.orderNo){s.value=!0;return}B("\u6CA1\u6709\u8BA2\u5355\u53F7!")},N=F(),T=()=>{a.value=!1,m()};return()=>e(_,null,[n.length?e("div",{class:r.cartConfirm},[e("div",{class:r.cartConfirmBox},[e(G,{item:V,isLink:!1},null)]),e("div",{style:{marginTop:"20px"},class:[r.cartBox,r.cartConfirmBox]},[e("div",{class:r.shopBox},[n.map(o=>e("div",{class:[r.cartItem],style:{marginBottom:"10px"}},[e(R,{price:S(o.productPrice),desc:D(o.productAttr),title:o.productName,thumb:o.productPic,num:o.productQuantity},null)]))]),e(q,{border:!1},{default:()=>[e(w,{border:!1,title:"\u603B\u989D",value:"\xA5 "+l.totalAmount},null)]})]),e("div",{class:r.payProtocol},[e(H,{modelValue:d.value,"onUpdate:modelValue":o=>d.value=o},null),e(L,{buttonText:`\u7ED3\u7B97(${n.length})`,buttonColor:"var(--van-primary)",disabled:n.length===0,onSubmit:()=>m()},{default:()=>[e("div",{class:r.confirmBottom},[P("\u5408\u8BA1")," ",e("span",{class:r["price-des"]},[P("\xA5"),S(l.payAmount)])])]})]),e("div",{style:{height:"var(--van-submit-bar-height)"}},null),e(E,{modelValue:a.value,"onUpdate:modelValue":o=>a.value=o},{default:()=>[e(J,{onSuccess:T},null)]}),e(M,{show:s.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[e(Q,{modelValue:s.value,"onUpdate:modelValue":o=>s.value=o,orderInfo:u,paymentType:"goodsPay",onBackOut:()=>s.value=!1},null)]})]):e($,{buttonText:"\u53BB\u8D2D\u7269\u8F66",onClick:()=>{N.push({path:"/cart"})}},null)])}});export{ge as default};
