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.088d07fe.js","./index-legacy.d77a1394.js","./index-legacy.47f904f4.js","./index-legacy.fb6f2309.js","./index-legacy.958bfabf.js","./index-legacy.6795e61d.js","./index-legacy.4f295f67.js","./cart-legacy.ce217835.js","./index.module-legacy.2b6ca4e3.js","./index-legacy.0592cbcd.js","./index-legacy.7c708c34.js","./index-legacy.843058f9.js","./index-legacy.7770632d.js","./index-legacy.e79f682c.js","./index-legacy.9f02980e.js","./index-legacy.ab524b39.js","./index-legacy.062d49e9.js","./icon_checkbox_default-legacy.e33240bc.js","./index-legacy.6168d53d.js","./index-legacy.e7620068.js","./use-height-legacy.166530e2.js","./index-legacy.4f0a81cc.js","./hooks-legacy.dea977fc.js","./index-legacy.c610561c.js","./index-legacy.666b8d34.js","./index-legacy.0364b3a2.js","./index-legacy.fc0040e4.js","./use-id-legacy.a726c7df.js","./index-legacy.3db9a70d.js","./item-legacy.844d8bc4.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,L,k,S,B,R,w,N,O,T;return{setters:[function(e){t=e.d,o=e.O,r=e.L,c=e.P,a=e.e,u=e.a$,i=e.bz,l=e.bw,s=e.N,d=e.Z,f=e.M,m=e.i,v=e.bu,p=e.w,y=e.aQ,g=e.C,x=e.F,b=e.aE,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){L=e.c,k=e.f},function(e){S=e.s},function(e){B=e.A},function(e){R=e.C},function(e){w=e.P},function(e){N=e.C},function(e){O=e.U},function(e){T=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();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&&(L.calcAmount=c.calcAmount,L.cartPromotionItemList=c.cartPromotionItemList,L.memberReceiveAddressList=c.memberReceiveAddressList),n.next=13;break;case 11:n.prev=11,n.t0=n.catch(2);case 13:e.value=!1,L.memberReceiveAddressList.length&&(u=L.memberReceiveAddressList.find((function(e){return e.defaultStatus}))||L.memberReceiveAddressList[0])&&(V.value=u);case 15:case"end":return n.stop()}}),n,null,[[2,11]])}))));var U=function(e){V.value=e};c((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),z=s({orderNo:"",actualPrice:0,couponId:""});d(_,(function(e,n){_.value?j({api:"setBarStatus",content:{status:0}}):j({api:"setBarStatus",content:{status:1}})}));var D=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?z.orderNo?F.value=!0:G():_.value=!0}else b("请先阅读并同意《酷乐秀平台服务协议》");else b("请选择收货地址")},E=f(),G=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=L.cartPromotionItemList.reduce((function(e,n){return e.push(n.id),e}),[]),o=L.calcAmount.payAmount-L.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: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 E.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,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)}}(),H=function(){_.value=!1,D()};return function(){return m(x,null,[e.value?null:m("div",null,[L.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},[L.cartPromotionItemList.map((function(e){return m("div",{class:[S.cartItem],style:{marginBottom:"10px"}},[m(h,{price:v(e.price),desc:k(e.productAttr),title:e.productName,thumb:e.productPic,num:e.quantity},null)])}))]),m(P,{border:!1},{default:function(){return[m(T,{orderType:"GOODS",orderAmount:L.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(",");L.calcAmount.promotionAmount=n,z.couponId=t}},null),m(I,{border:!1,title:"总额",value:"¥ "+v(L.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(L.cartPromotionItemList.length,")"),buttonColor:"var(--van-primary)",disabled:0===L.cartPromotionItemList.length,onSubmit:function(){return D()}},{default:function(){return[m("div",{class:S.confirmBottom},[p("合计")," ",m("span",{class:S["price-des"]},[p("¥"),v(L.calcAmount.payAmount-L.calcAmount.promotionAmount>=0?L.calcAmount.payAmount-L.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:H},null)]}}),m(y,{show:F.value,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:function(){return[m(w,{modelValue:F.value,"onUpdate:modelValue":function(e){return F.value=e},orderInfo:z,paymentType:"goodsPay",onBackOut:function(){return F.value=!1}},null)]}})]):m(g,{buttonText:"去购物车",onClick:function(){E.push({path:"/cart"})}},null)])])}}}))}}}))}();
|