1 |
- !function(){function e(e,n,t,o,r,c,a){try{var u=e[c](a),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,c){var a=n.apply(t,o);function u(n){e(a,r,c,u,i,"next",n)}function i(n){e(a,r,c,u,i,"throw",n)}u(void 0)}))}}System.register(["./index-legacy.fba2875c.js","./index-legacy.d92f7da7.js","./index-legacy.78361179.js","./index-legacy.aa1e9cdc.js","./index-legacy.7dcec7b3.js","./index-legacy.f231f1c5.js","./index-legacy.fc62badd.js","./cart-legacy.df78b0a7.js","./index.module-legacy.2b6ca4e3.js","./index-legacy.905e666f.js","./index-legacy.b554edea.js","./index-legacy.5347388e.js","./index-legacy.2049c355.js","./index-legacy.8ed66537.js","./index-legacy.d5464152.js","./index-legacy.45490234.js","./index-legacy.32d1c54d.js","./icon_checkbox_default-legacy.e33240bc.js","./icon_checkbox-tenant-legacy.2501219f.js","./index-legacy.e7460ea1.js","./index-legacy.40eca993.js","./use-height-legacy.233a2ec8.js","./index-legacy.23cbc114.js","./hooks-legacy.148eb332.js","./index-legacy.a8eec4ea.js","./index-legacy.fc77fe4f.js","./index-legacy.8921f068.js","./use-id-legacy.db87b112.js","./index-legacy.21d121b2.js","./item-legacy.bb13e4ca.js"],(function(e){"use strict";var t,o,r,c,a,u,i,l,s,d,f,m,v,p,y,g,x,b,A,j,h,I,P,C,k,L,S,R,B,O,T,w,N;return{setters:[function(e){t=e.d,o=e.S,r=e.O,c=e.U,a=e.w,u=e.b0,i=e.bC,l=e.bq,s=e.Q,d=e.a2,f=e.P,m=e.j,v=e.by,p=e.z,y=e.aR,g=e.C,x=e.F,b=e.T,A=e.g,j=e.n},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){R=e.A},function(e){B=e.C},function(e){O=e.P},function(e){T=e.C},function(e){w=e.U},function(e){N=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(),U=o();c(n(regeneratorRuntime.mark((function n(){var o,r,c,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,a.post("/api-mall-portal/order/generateConfirmOrder",{params:{cartIds:t.query.cartIds}});case 5:o=n.sent,r=o.code,c=o.data,200===r&&(k.calcAmount=c.calcAmount,k.cartPromotionItemList=c.cartPromotionItemList,k.memberReceiveAddressList=c.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])&&(U.value=u);case 15:case"end":return n.stop()}}),n,null,[[2,11]])}))));var V=function(e){U.value=e};c((function(){u("getAddress",(function(e){V((null==e?void 0:e.content)||{})}))})),i((function(){l("getAddress",(function(){}))}));var q=o(!1),_=o(!1),F=o(!1),z=s({orderNo:"",actualPrice:0,couponId:""});d(F,(function(e,n){F.value?j({api:"setBarStatus",content:{status:0}}):j({api:"setBarStatus",content:{status:1}})}));var D=function(){var e;if(null!==(e=U.value)&&void 0!==e&&e.id)if(q.value){var n=A.user.data;null!=n&&n.realName&&null!=n&&n.idCardNo?z.orderNo?_.value=!0:H():F.value=!0}else b("请先阅读并同意《酷乐秀平台服务协议》");else b("请选择收货地址")},G=f(),H=function(){var e=n(regeneratorRuntime.mark((function e(){var n,t,o,r,c,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=U.value)||void 0===n?void 0:n.id,platformType:A.platformType,orderAmount:Number((o>=0?o:0).toFixed(2)),couponId:z.couponId},e.prev=3,e.next=6,a.post("/api-mall-portal/order/generateOrder",{data:r});case 6:if(c=e.sent,u=c.code,i=c.data,200!==u){e.next=16;break}if(1!==i.order.status){e.next=13;break}return G.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:_.value=!0,z.orderNo=(null==i?void 0:i.order.orderSn)||"",z.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)}}(),Q=function(){F.value=!1,D()};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(R,{item:U.value,setAddress:V},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(N,{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,z.couponId=t}},null),m(I,{border:!1,title:"总额",value:"¥ "+v(k.calcAmount.totalAmount)},null)]}})]),m("div",{class:S.payProtocol},[m(B,{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 D()}},{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(T,{modelValue:F.value,"onUpdate:modelValue":function(e){return F.value=e}},{default:function(){return[m(w,{onSuccess:Q},null)]}}),m(y,{show:_.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:function(){return[m(O,{modelValue:_.value,"onUpdate:modelValue":function(e){return _.value=e},orderInfo:z,paymentType:"goodsPay",onBackOut:function(){return _.value=!1}},null)]}})]):m(g,{buttonText:"去购物车",onClick:function(){G.push({path:"/cart"})}},null)])])}}}))}}}))}();
|