!function(){function e(e,n,t,o,r,a,c){try{var u=e[a](c),i=u.value}catch(l){return void t(l)}u.done?n(i):Promise.resolve(i).then(o,r)}function n(n){return function(){var t=this,o=arguments;return new Promise((function(r,a){var c=n.apply(t,o);function u(n){e(c,r,a,u,i,"next",n)}function i(n){e(c,r,a,u,i,"throw",n)}u(void 0)}))}}System.register(["./index-legacy.f8641610.js","./index-legacy.c8b60294.js","./index-legacy.28050159.js","./index-legacy.37e9f27c.js","./index-legacy.fc510843.js","./index-legacy.c36297f9.js","./index-legacy.2e2f724a.js","./cart-legacy.2a6d84fa.js","./index.module-legacy.2b6ca4e3.js","./index-legacy.c933a693.js","./index-legacy.5032bf00.js","./index-legacy.f3e05e77.js","./index-legacy.a47aea4d.js","./index-legacy.697c598b.js","./index-legacy.30b3a55f.js","./index-legacy.421c6f71.js","./index-legacy.aee47fad.js","./icon_checkbox_default-legacy.e33240bc.js","./index-legacy.78c8492b.js","./index-legacy.90f7f902.js","./use-height-legacy.be763bb2.js","./index-legacy.1dea7f77.js","./hooks-legacy.1d4168e3.js","./index-legacy.c3bbeade.js","./index-legacy.957c23ee.js","./index-legacy.8bfe8003.js","./index-legacy.8a3dede6.js","./use-id-legacy.30c2e9af.js","./index-legacy.3442906b.js","./item-legacy.408891a4.js"],(function(e){"use strict";var t,o,r,a,c,u,i,l,s,d,f,m,v,p,y,g,x,b,A,j,h,I,P,C,k,L,S,B,R,T,N,O,w;return{setters:[function(e){t=e.d,o=e.U,r=e.P,a=e.V,c=e.e,u=e.b1,i=e.bC,l=e.br,s=e.S,d=e.a3,f=e.Q,m=e.i,v=e.by,p=e.A,y=e.aT,g=e.C,x=e.F,b=e.T,A=e.s,j=e.p},function(){},function(){},function(e){h=e.C},function(e){I=e.C},function(e){P=e.C},function(e){C=e.S},function(e){k=e.c,L=e.f},function(e){S=e.s},function(e){B=e.A},function(e){R=e.C},function(e){T=e.P},function(e){N=e.C},function(e){O=e.U},function(e){w=e.U},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){e("default",t({name:"cartConfirm",setup:function(){var e=o(!0),t=r(),V=o();a(n(regeneratorRuntime.mark((function n(){var o,r,a,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.value=!0,!t.query.cartIds){n.next=13;break}return n.prev=2,n.next=5,c.post("/api-mall-portal/order/generateConfirmOrder",{params:{cartIds:t.query.cartIds}});case 5:o=n.sent,r=o.code,a=o.data,200===r&&(k.calcAmount=a.calcAmount,k.cartPromotionItemList=a.cartPromotionItemList,k.memberReceiveAddressList=a.memberReceiveAddressList),n.next=13;break;case 11:n.prev=11,n.t0=n.catch(2);case 13:e.value=!1,k.memberReceiveAddressList.length&&(u=k.memberReceiveAddressList.find((function(e){return e.defaultStatus}))||k.memberReceiveAddressList[0])&&(V.value=u);case 15:case"end":return n.stop()}}),n,null,[[2,11]])}))));var U=function(e){V.value=e};a((function(){u("getAddress",(function(e){U((null==e?void 0:e.content)||{})}))})),i((function(){l("getAddress",(function(){}))}));var q=o(!1),F=o(!1),_=o(!1),D=s({orderNo:"",actualPrice:0,couponId:""});d(_,(function(e,n){_.value?j({api:"setBarStatus",content:{status:0}}):j({api:"setBarStatus",content:{status:1}})}));var G=function(){var e;if(null!==(e=V.value)&&void 0!==e&&e.id)if(q.value){var n=A.user.data;null!=n&&n.realName&&null!=n&&n.idCardNo?D.orderNo?F.value=!0:Q():_.value=!0}else b("请先阅读并同意《酷乐秀平台服务协议》");else b("请选择收货地址")},H=f(),Q=function(){var e=n(regeneratorRuntime.mark((function e(){var n,t,o,r,a,u,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=k.cartPromotionItemList.reduce((function(e,n){return e.push(n.id),e}),[]),o=k.calcAmount.payAmount-k.calcAmount.promotionAmount,r={cartIds:t,memberReceiveAddressId:null===(n=V.value)||void 0===n?void 0:n.id,platformType:A.platformType,orderAmount:Number((o>=0?o:0).toFixed(2)),couponId:D.couponId},e.prev=3,e.next=6,c.post("/api-mall-portal/order/generateOrder",{data:r});case 6:if(a=e.sent,u=a.code,i=a.data,200!==u){e.next=16;break}if(1!==i.order.status){e.next=13;break}return H.replace({path:"/shopTrade",query:{orderNo:null==i?void 0:i.order.orderSn,id:null==i?void 0:i.order.id}}),e.abrupt("return");case 13:F.value=!0,D.orderNo=(null==i?void 0:i.order.orderSn)||"",D.actualPrice=(null==i?void 0:i.order.payAmount)||0;case 16:e.next=20;break;case 18:e.prev=18,e.t0=e.catch(3);case 20:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),z=function(){_.value=!1,G()};return function(){return m(x,null,[e.value?null:m("div",null,[k.cartPromotionItemList.length?m("div",{class:S.cartConfirm},[m("div",{class:S.cartConfirmBox},[m(B,{item:V.value,setAddress:U},null)]),m("div",{style:{marginTop:"20px"},class:[S.cartBox,S.cartConfirmBox]},[m("div",{class:S.shopBox},[k.cartPromotionItemList.map((function(e){return m("div",{class:[S.cartItem],style:{marginBottom:"10px"}},[m(h,{price:v(e.price),desc:L(e.productAttr),title:e.productName,thumb:e.productPic,num:e.quantity},null)])}))]),m(P,{border:!1},{default:function(){return[m(w,{orderType:"GOODS",orderAmount:k.calcAmount.totalAmount,onCouponSelect:function(e){var n=e.map((function(e){return e.discountPrice})).reduce((function(e,n){return e+n}),0),t=e.map((function(e){return e.couponIssueId})).join(",");k.calcAmount.promotionAmount=n,D.couponId=t}},null),m(I,{border:!1,title:"总额",value:"¥ "+v(k.calcAmount.totalAmount)},null)]}})]),m("div",{class:S.payProtocol},[m(R,{modelValue:q.value,"onUpdate:modelValue":function(e){return q.value=e}},null),m(C,{buttonText:"结算(".concat(k.cartPromotionItemList.length,")"),buttonColor:"var(--van-primary)",disabled:0===k.cartPromotionItemList.length,onSubmit:function(){return G()}},{default:function(){return[m("div",{class:S.confirmBottom},[p("合计")," ",m("span",{class:S["price-des"]},[p("¥"),v(k.calcAmount.payAmount-k.calcAmount.promotionAmount>=0?k.calcAmount.payAmount-k.calcAmount.promotionAmount:0)])])]}})]),m("div",{style:{height:"var(--van-submit-bar-height)"}},null),m(N,{modelValue:_.value,"onUpdate:modelValue":function(e){return _.value=e}},{default:function(){return[m(O,{onSuccess:z},null)]}}),m(y,{show:F.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:function(){return[m(T,{modelValue:F.value,"onUpdate:modelValue":function(e){return F.value=e},orderInfo:D,paymentType:"goodsPay",onBackOut:function(){return F.value=!1}},null)]}})]):m(g,{buttonText:"去购物车",onClick:function(){H.push({path:"/cart"})}},null)])])}}}))}}}))}();