import{d as O,l as i,h as F,_ as R,k as _,a as e,aA as w,y as L,C as B,ay as M,j as S,P as z,F as D,T as N}from"./vendor.cd162bf7.js";/* empty css               *//* empty css                *//* empty css                *//* empty css              *//* empty css               *//* empty css                */import{c as t,f as G}from"./cart.c528d3d4.js";import{s as r}from"./index.module.0e920025.js";import{A as H}from"./index.17e81428.js";import{C as Q}from"./index.affad28a.js";import{P as W}from"./index.3b7edb7c.js";import{o as V,C as $,s as q}from"./index.a9c80450.js";import{C as E}from"./index.de3e7139.js";import{U as J}from"./index.f53294d4.js";/* empty css                *//* empty css                */import"./icon_checkbox_default.2fe5d57e.js";import"./index.d3c070ae.js";/* empty css               *//* empty css               */import"./orderStatus.86d72629.js";import"./index.339fc024.js";import"./index.fd2af93d.js";/* empty css               *//* empty css               */var ge=O({name:"cartConfirmAgin",setup(){var c,p,f,v,x,j,A,h,y,C,b,g,I,P;const n=((c=t.orderInfo)==null?void 0:c.orderItemList)||[],d={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,couponAmount:(x=t.orderInfo)==null?void 0:x.couponAmount};i(0);const T={city:(j=t.orderInfo)==null?void 0:j.receiverCity,detailAddress:(A=t.orderInfo)==null?void 0:A.receiverDetailAddress,name:(h=t.orderInfo)==null?void 0:h.receiverName,phoneNumber:(y=t.orderInfo)==null?void 0:y.receiverPhone,postCode:(C=t.orderInfo)==null?void 0:C.receiverPostCode,province:(b=t.orderInfo)==null?void 0:b.receiverProvince,region:(g=t.orderInfo)==null?void 0:g.receiverRegion},l=i(!1),s=i(!1),a=i(!1),u=F({orderNo:((I=t.orderInfo)==null?void 0:I.orderSn)||"",actualPrice:((P=t.orderInfo)==null?void 0:P.payAmount)||0});R(a,(o,K)=>{a.value?postMessage({api:"setBarStatus",content:{status:0}}):postMessage({api:"setBarStatus",content:{status:1}})});const m=()=>{if(!l.value){N("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u9177\u4E50\u79C0\u5E73\u53F0\u670D\u52A1\u534F\u8BAE\u300B");return}const o=q.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}N("\u6CA1\u6709\u8BA2\u5355\u53F7!")},k=_(),U=()=>{a.value=!1,m()};return()=>e(D,null,[n.length?e("div",{class:r.cartConfirm},[e("div",{class:r.cartConfirmBox},[e(H,{item:T,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(w,{price:V(o.productPrice),desc:G(o.productAttr),title:o.productName,thumb:o.productPic,num:o.productQuantity},null)]))]),e(L,{border:!1},{default:()=>[e(B,{border:!1,title:"\u4F18\u60E0\u52B5"},{value:()=>e("span",{style:{fontSize:"0.42667rem",color:"#ff3535",fontWeight:"bold"}},["-\xA5 "+d.couponAmount])}),e(B,{border:!1,title:"\u603B\u989D",value:"\xA5 "+d.totalAmount},null)]})]),e("div",{class:r.payProtocol},[e(Q,{modelValue:l.value,"onUpdate:modelValue":o=>l.value=o},null),e(M,{buttonText:`\u7ED3\u7B97(${n.length})`,buttonColor:"var(--van-primary)",disabled:n.length===0,onSubmit:()=>m()},{default:()=>[e("div",{class:r.confirmBottom},[S("\u5408\u8BA1")," ",e("span",{class:r["price-des"]},[S("\xA5"),V(d.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:U},null)]}),e(z,{show:s.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[e(W,{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:()=>{k.push({path:"/cart"})}},null)])}});export{ge as default};
