import{d as F,U as l,S as R,a3 as w,Q as L,i as o,by as S,A as N,aT as M,C as Q,F as z,T as V,s as D}from"./index.7994470a.js";import"./index.2fbdc579.js";import"./index.0262b810.js";import{C as G}from"./index.100c0398.js";import{C as T}from"./index.777f4790.js";import{C as H}from"./index.9cdb5783.js";import{S as W}from"./index.4d16ec29.js";import{c as t,f as $}from"./cart.d2ad347e.js";import{s as r}from"./index.module.0e920025.js";import{A as j}from"./index.41a799c7.js";import{C as q}from"./index.36a55b1c.js";import{P as E}from"./index.981b3b32.js";import{C as J}from"./index.895996db.js";import{U as K}from"./index.89f739a7.js";import"./index.29eb1675.js";import"./index.c9af17c2.js";import"./icon_checkbox_default.2fe5d57e.js";import"./index.c5bf3ab5.js";import"./index.0a2aeb2c.js";import"./use-height.ffa5a0f3.js";import"./index.9dc8689d.js";import"./hooks.04c1f931.js";import"./index.570461cd.js";import"./index.f9e55fe3.js";import"./index.80389b79.js";import"./index.3dd26d27.js";import"./use-id.117b75b2.js";import"./index.a241f507.js";var So=F({name:"cartConfirmAgin",setup(){var d,c,f,v,A,C,y,h,g,I,b,P,x,B;const n=((d=t.orderInfo)==null?void 0:d.orderItemList)||[],u={totalAmount:((c=t.orderInfo)==null?void 0:c.totalAmount)||0,payAmount:((f=t.orderInfo)==null?void 0:f.payAmount)||0,freightAmount:((v=t.orderInfo)==null?void 0:v.freightAmount)||0,couponAmount:(A=t.orderInfo)==null?void 0:A.couponAmount};l(0);const U={city:(C=t.orderInfo)==null?void 0:C.receiverCity,detailAddress:(y=t.orderInfo)==null?void 0:y.receiverDetailAddress,name:(h=t.orderInfo)==null?void 0:h.receiverName,phoneNumber:(g=t.orderInfo)==null?void 0:g.receiverPhone,postCode:(I=t.orderInfo)==null?void 0:I.receiverPostCode,province:(b=t.orderInfo)==null?void 0:b.receiverProvince,region:(P=t.orderInfo)==null?void 0:P.receiverRegion},i=l(!1),s=l(!1),a=l(!1),m=R({orderNo:((x=t.orderInfo)==null?void 0:x.orderSn)||"",actualPrice:((B=t.orderInfo)==null?void 0:B.payAmount)||0});w(a,(e,X)=>{a.value?postMessage({api:"setBarStatus",content:{status:0}}):postMessage({api:"setBarStatus",content:{status:1}})});const p=()=>{if(!i.value){V("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u9177\u4E50\u79C0\u5E73\u53F0\u670D\u52A1\u534F\u8BAE\u300B");return}const e=D.user.data;if(!(e!=null&&e.realName)||!(e!=null&&e.idCardNo)){a.value=!0;return}if(m.orderNo){s.value=!0;return}V("\u6CA1\u6709\u8BA2\u5355\u53F7!")},k=L(),O=()=>{a.value=!1,p()};return()=>o(z,null,[n.length?o("div",{class:r.cartConfirm},[o("div",{class:r.cartConfirmBox},[o(j,{item:U,isLink:!1},null)]),o("div",{style:{marginTop:"20px"},class:[r.cartBox,r.cartConfirmBox]},[o("div",{class:r.shopBox},[n.map(e=>o("div",{class:[r.cartItem],style:{marginBottom:"10px"}},[o(G,{price:S(e.productPrice),desc:$(e.productAttr),title:e.productName,thumb:e.productPic,num:e.productQuantity},null)]))]),o(H,{border:!1},{default:()=>[o(T,{border:!1,title:"\u4F18\u60E0\u5238"},{value:()=>o("span",{style:{fontSize:"0.42667rem",color:"#ff3535",fontWeight:"bold"}},["-\xA5 "+u.couponAmount])}),o(T,{border:!1,title:"\u603B\u989D",value:"\xA5 "+u.totalAmount},null)]})]),o("div",{class:r.payProtocol},[o(q,{modelValue:i.value,"onUpdate:modelValue":e=>i.value=e},null),o(W,{buttonText:`\u7ED3\u7B97(${n.length})`,buttonColor:"var(--van-primary)",disabled:n.length===0,onSubmit:()=>p()},{default:()=>[o("div",{class:r.confirmBottom},[N("\u5408\u8BA1")," ",o("span",{class:r["price-des"]},[N("\xA5"),S(u.payAmount)])])]})]),o("div",{style:{height:"var(--van-submit-bar-height)"}},null),o(J,{modelValue:a.value,"onUpdate:modelValue":e=>a.value=e},{default:()=>[o(K,{onSuccess:O},null)]}),o(M,{show:s.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[o(E,{modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,orderInfo:m,paymentType:"goodsPay",onBackOut:()=>s.value=!1},null)]})]):o(Q,{buttonText:"\u53BB\u8D2D\u7269\u8F66",onClick:()=>{k.push({path:"/cart"})}},null)])}});export{So as default};
