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