index-legacy.78d67b7d.js 6.5 KB

1
  1. !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.8d60aee1.js","./index-legacy.4a75d877.js","./index-legacy.a85d660d.js","./index-legacy.ca6783b0.js","./index-legacy.610f0a70.js","./index-legacy.fd89cccf.js","./index-legacy.04792b47.js","./cart-legacy.5c61b32e.js","./index.module-legacy.2b6ca4e3.js","./index-legacy.f8d65221.js","./index-legacy.57582d06.js","./index-legacy.88e965aa.js","./index-legacy.f8ebe92d.js","./index-legacy.8069d9ea.js","./index-legacy.5c9f7133.js","./index-legacy.87bcd48f.js","./index-legacy.5e551733.js","./index-legacy.4e5c868b.js","./icon_checkbox-legacy.6421631e.js","./icon_checkbox-tenant-legacy.b4d3b7a3.js","./icon_checkbox_default-legacy.9f3738fd.js","./index-legacy.df0bf034.js","./hooks-legacy.f81762aa.js","./index-legacy.2a290207.js","./index-legacy.f8f0c467.js","./index-legacy.7df716cf.js","./index-legacy.78ce4f6b.js","./use-id-legacy.54528695.js","./index-legacy.6f523508.js","./index-legacy.69a58442.js","./item-legacy.5685cd99.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,C,P,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.bi,i=e.S,l=e.a3,s=e.Q,d=e.j,f=e.bC,m=e.A,v=e.aS,p=e.C,y=e.F,g=e.T,x=e.g,b=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){C=e.c,P=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(){},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&&(C.calcAmount=a.calcAmount,C.cartPromotionItemList=a.cartPromotionItemList,C.memberReceiveAddressList=a.memberReceiveAddressList),n.next=13;break;case 11:n.prev=11,n.t0=n.catch(2);case 13:e.value=!1,C.memberReceiveAddressList.length&&(u=C.memberReceiveAddressList.find((function(e){return e.defaultStatus}))||C.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),_=o(!1),D=i({orderNo:"",actualPrice:0,couponId:""});l(_,(function(e,n){_.value?b({api:"setBarStatus",content:{status:0}}):b({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=x.user.data;null!=n&&n.realName&&null!=n&&n.idCardNo?D.orderNo?q.value=!0:G():_.value=!0}else g("请先阅读并同意《酷乐秀平台服务协议》");else g("请选择收货地址")},z=s(),G=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=C.cartPromotionItemList.reduce((function(e,n){return e.push(n.id),e}),[]),o=C.calcAmount.payAmount-C.calcAmount.promotionAmount,r={cartIds:t,memberReceiveAddressId:null===(n=w.value)||void 0===n?void 0:n.id,platformType:x.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 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,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)}}(),H=function(){_.value=!1,F()};return function(){return d(y,null,[d(T,null,null),e.value?null:d("div",null,[C.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},[C.cartPromotionItemList.map((function(e){return d("div",{class:[S.cartItem],style:{marginBottom:"10px"}},[d(A,{price:f(e.price),desc:P(e.productAttr),title:e.productName,thumb:e.productPic,num:e.quantity},null)])}))]),d(h,{border:!1},{default:function(){return[d(N,{orderType:"GOODS",orderAmount:C.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(",");C.calcAmount.promotionAmount=n,D.couponId=t}},null),d(j,{border:!1,title:"总额",value:"¥ "+f(C.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(C.cartPromotionItemList.length,")"),buttonColor:"var(--van-primary)",disabled:0===C.cartPromotionItemList.length,onSubmit:function(){return F()}},{default:function(){return[d("div",{class:S.confirmBottom},[m("合计")," ",d("span",{class:S["price-des"]},[m("¥"),f(C.calcAmount.payAmount-C.calcAmount.promotionAmount>=0?C.calcAmount.payAmount-C.calcAmount.promotionAmount:0)])])]}})]),d("div",{style:{height:"var(--van-submit-bar-height)"}},null),d(B,{modelValue:_.value,"onUpdate:modelValue":function(e){return _.value=e}},{default:function(){return[d(O,{onSuccess:H},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:D,paymentType:"goodsPay",onBackOut:function(){return q.value=!1}},null)]}})]):d(p,{buttonText:"去购物车",onClick:function(){z.push({path:"/cart"})}},null)])])}}}))}}}))}();