!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(["./ResizeObserver.es-legacy.9ef5ac8c.js","./index-legacy.8802e914.js","./index-legacy.31c9aada.js","./index-legacy.3a99d31d.js","./index-legacy.e9381954.js","./index-legacy.6268a8fe.js","./index-legacy.70e40a8d.js","./cart-legacy.1784383f.js","./index.module-legacy.2b6ca4e3.js","./index-legacy.34f839d4.js","./index-legacy.6080cd99.js","./index-legacy.b9083004.js","./index-legacy.a455b978.js","./index-legacy.2635f4ef.js","./index-legacy.ec70c98f.js","./index-legacy.402479d8.js","./index-legacy.cb998bd0.js","./index-legacy.5893ff71.js","./icon_checkbox_default-legacy.e33240bc.js","./icon_checkbox-tenant-legacy.b4d3b7a3.js","./index-legacy.b0e8bd5d.js","./hooks-legacy.b4b15558.js","./index-legacy.f8ead3f2.js","./index-legacy.8b605db5.js","./index-legacy.b5b73462.js","./use-id-legacy.4538a8e2.js","./index-legacy.74b0b0cb.js","./index-legacy.5ed99b3c.js","./item-legacy.efc7cf52.js"],(function(e){"use strict";var t,o,r,a,c,u,i,l,s,d,f,m,v,p,y,g,b,x,A,j,h,I,P,C,S,k,L,R,B,O,N,T;return{setters:[function(e){t=e.d,o=e.U,r=e.P,a=e.V,c=e.y,u=e.bE,i=e.S,l=e.a3,s=e.Q,d=e.j,f=e.bA,m=e.A,v=e.aS,p=e.C,y=e.F,g=e.T,b=e.g,x=e.n},function(){},function(){},function(e){A=e.C},function(e){j=e.C},function(e){h=e.C},function(e){I=e.S},function(e){P=e.c,C=e.f},function(e){S=e.s},function(e){k=e.A},function(e){L=e.C},function(e){R=e.P},function(e){B=e.C},function(e){O=e.U},function(e){N=e.U},function(e){T=e.C},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(),w=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&&(P.calcAmount=a.calcAmount,P.cartPromotionItemList=a.cartPromotionItemList,P.memberReceiveAddressList=a.memberReceiveAddressList),n.next=13;break;case 11:n.prev=11,n.t0=n.catch(2);case 13:e.value=!1,P.memberReceiveAddressList.length&&(u=P.memberReceiveAddressList.find((function(e){return e.defaultStatus}))||P.memberReceiveAddressList[0])&&(w.value=u);case 15:case"end":return n.stop()}}),n,null,[[2,11]])}))));var V=function(e){w.value=e};a((function(){var e=sessionStorage.getItem("addressDetails");e=e?JSON.parse(e):{},w.value=e,sessionStorage.removeItem("addressDetails")})),u((function(){}));var U=o(!1),q=o(!1),D=o(!1),_=i({orderNo:"",actualPrice:0,couponId:""});l(D,(function(e,n){D.value?x({api:"setBarStatus",content:{status:0}}):x({api:"setBarStatus",content:{status:1}})}));var F=function(){var e;if(null!==(e=w.value)&&void 0!==e&&e.id)if(U.value){var n=b.user.data;null!=n&&n.realName&&null!=n&&n.idCardNo?_.orderNo?q.value=!0:E():D.value=!0}else g("请先阅读并同意《酷乐秀平台服务协议》");else g("请选择收货地址")},z=s(),E=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=P.cartPromotionItemList.reduce((function(e,n){return e.push(n.id),e}),[]),o=P.calcAmount.payAmount-P.calcAmount.promotionAmount,r={cartIds:t,memberReceiveAddressId:null===(n=w.value)||void 0===n?void 0:n.id,platformType:b.platformType,orderAmount:Number((o>=0?o:0).toFixed(2)),couponId:_.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 z.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:q.value=!0,_.orderNo=(null==i?void 0:i.order.orderSn)||"",_.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)}}(),G=function(){D.value=!1,F()};return function(){return d(y,null,[d(T,null,null),e.value?null:d("div",null,[P.cartPromotionItemList.length?d("div",{class:S.cartConfirm},[d("div",{class:S.cartConfirmBox},[d(k,{item:w.value,setAddress:V},null)]),d("div",{style:{marginTop:"20px"},class:[S.cartBox,S.cartConfirmBox]},[d("div",{class:S.shopBox},[P.cartPromotionItemList.map((function(e){return d("div",{class:[S.cartItem],style:{marginBottom:"10px"}},[d(A,{price:f(e.price),desc:C(e.productAttr),title:e.productName,thumb:e.productPic,num:e.quantity},null)])}))]),d(h,{border:!1},{default:function(){return[d(N,{orderType:"GOODS",orderAmount:P.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(",");P.calcAmount.promotionAmount=n,_.couponId=t}},null),d(j,{border:!1,title:"总额",value:"¥ "+f(P.calcAmount.totalAmount)},null)]}})]),d("div",{class:S.payProtocol},[d(L,{modelValue:U.value,"onUpdate:modelValue":function(e){return U.value=e}},null),d(I,{buttonText:"结算(".concat(P.cartPromotionItemList.length,")"),buttonColor:"var(--van-primary)",disabled:0===P.cartPromotionItemList.length,onSubmit:function(){return F()}},{default:function(){return[d("div",{class:S.confirmBottom},[m("合计")," ",d("span",{class:S["price-des"]},[m("¥"),f(P.calcAmount.payAmount-P.calcAmount.promotionAmount>=0?P.calcAmount.payAmount-P.calcAmount.promotionAmount:0)])])]}})]),d("div",{style:{height:"var(--van-submit-bar-height)"}},null),d(B,{modelValue:D.value,"onUpdate:modelValue":function(e){return D.value=e}},{default:function(){return[d(O,{onSuccess:G},null)]}}),d(v,{show:q.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:function(){return[d(R,{modelValue:q.value,"onUpdate:modelValue":function(e){return q.value=e},orderInfo:_,paymentType:"goodsPay",onBackOut:function(){return q.value=!1}},null)]}})]):d(p,{buttonText:"去购物车",onClick:function(){z.push({path:"/cart"})}},null)])])}}}))}}}))}();