index-legacy.cb3eea43.js 8.5 KB

1
  1. !function(){function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return e(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function n(t,e,n,o,u,r,i){try{var c=t[r](i),a=c.value}catch(s){return void n(s)}c.done?e(a):Promise.resolve(a).then(o,u)}function o(t){return function(){var e=this,o=arguments;return new Promise((function(u,r){var i=t.apply(e,o);function c(t){n(i,u,r,c,a,"next",t)}function a(t){n(i,u,r,c,a,"throw",t)}c(void 0)}))}}var u=document.createElement("style");u.innerHTML="._useCoupon_1f0ud_1{padding-top:.42667rem;padding-bottom:.42667rem}._useCoupon_1f0ud_1 ._couponCount_1f0ud_5{color:#ff3535;font-size:.42667rem;font-weight:600}._useCoupon_1f0ud_1 ._couponCount_1f0ud_5 i{font-style:normal;font-size:.37333rem}._choiceCoupon_1f0ud_14{display:flex;flex-direction:column;overflow:hidden;height:100%}._couponTitle_1f0ud_20{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:0 .45333rem;height:1.6rem;line-height:1.6rem;font-size:.48rem;font-weight:600;color:#1a1a1a}._couponTitle_1f0ud_20 ._iconClose_1f0ud_32{display:inline-block;width:.64rem;height:.64rem;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAAG9QTFRFAAAAzMzM8fHx8/Pz6+vr8fHx6urq7Ozs6urq6+vr7Ozs6+vr6+vr6+vr6+vr7Ozs6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr7OzsZmZma2trbGxsgYGBj4+PysrKy8vLzMzMz8/P39/f6+vrszxq/gAAABp0Uk5TAAUSFhkkJVBXZmt1jY+2yM7b6/Hz9Pj8/v60zef/AAABRUlEQVRIx61W2baCMAyMIIvsm6ChgGD+/xvvA4gta+O580TITE+bpEkBljDdMEqzsszSKHRNOIHhxQ+S8Ig944B+De60wj247tAvfkGbKPzLFt9KaBeJteY7OR0gd5b8W0WHqG4L/pNO8FQUTkWnqKRd2TlpILfneCakheQTXZ804U/5LXQFxZjzgLQRAAAYcv28W9EMX3NoRPuW68oAAE9eokXEuvtYXY2Irez3ACCWfwhERPEajddoyf4YwFTqv8GvYuRjo9wPE1zlVEM9KyZ+PSgEF0I1Dt1IE30/fXSqP4RoEblpYSFQPs6MCFLaVmzzKYWM9hVrPmVQrvM5bR9Fv/aVfAF7S+xDs8PKThy7NNjFxy5v/gViX1F2E+C3GXYj47dK3WZs/d7u+QOFP7L4QxHAPhq79n8Mdv7T4YfHic7z5w+yIe8epvSUygAAAABJRU5ErkJggg==) no-repeat center;background-size:contain}._couponContent_1f0ud_39{flex:1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:.32rem .37333rem;--coupon-point: #fff}._couponFooter_1f0ud_46{display:flex;align-items:center;justify-content:space-between;line-height:1.49333rem;padding:0 .42667rem}._couponFooter_1f0ud_46 ._couponSelectText_1f0ud_53{font-size:.42667rem;color:#1a1a1a}._couponFooter_1f0ud_46 ._couponSelectText_1f0ud_53 span{padding:0 .24rem;font-weight:600;color:#fc1a19}._couponFooter_1f0ud_46 ._btnTenant_1f0ud_62{background-color:#fe2451;border:none;font-size:.42667rem}\n",document.head.appendChild(u),System.register(["./index-legacy.97a66b6e.js","./index-legacy.85b40712.js","./hooks-legacy.d4ee841e.js","./item-legacy.25eeb234.js"],(function(e){"use strict";var n,u,r,i,c,a,s,l,d,p,f,h,m;return{setters:[function(t){n=t.d,u=t.j,r=t.z,i=t.F,c=t.C,a=t.aS,s=t.B,l=t.g,d=t.w,p=t.aR},function(t){f=t.C},function(t){h=t.u},function(t){m=t.I}],execute:function(){var g="_useCoupon_1f0ud_1",A="_couponCount_1f0ud_5",_="_choiceCoupon_1f0ud_14",v="_couponTitle_1f0ud_20",y="_iconClose_1f0ud_32",C="_couponContent_1f0ud_39",b="_couponFooter_1f0ud_46",L="_couponSelectText_1f0ud_53",S="_btnTenant_1f0ud_62",I=n({name:"choice-coupon",props:{orderAmount:{type:Number,default:0},useCoupon:{type:Array,default:function(){return[]}},couponCategory:{type:String,default:"UNIVERSAL"},couponList:{type:Array,default:function(){return[]}}},emits:["close","submit"],data:function(){return{list:[],dataLoading:!1}},computed:{useLength:function(){return this.list.filter((function(t){return t.checked})).length||0}},mounted:function(){var e=this;return o(regeneratorRuntime.mark((function n(){var o,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.couponList.forEach((function(t){e.useCoupon.forEach((function(e){t.couponIssueId===e.couponIssueId&&(t.checked=!0)}))})),o=e.couponList.filter((function(t){return!t.disabled})),u=e.couponList.filter((function(t){return t.disabled})),e.list=[].concat(t(o),t(u)),e.calcCoupon(),h("优惠券");case 6:case"end":return n.stop()}}),n)})))()},methods:{onSubmit:function(){this.$emit("submit",this.list.filter((function(t){return t.checked}))),this.list.forEach((function(t){t.checked=!1}))},onSelect:function(t){t.checked=!t.checked,this.calcCoupon()},calcCoupon:function(){var t=this.list.filter((function(t){return t.checked})).map((function(t){return Number(t.useLimit||0)})),e=t.length>0?t.reduce((function(t,e){return t+e})):0,n=this.orderAmount-e;this.list.forEach((function(t){Number(t.useLimit)>n&&!t.checked?t.disabled=!0:t.disabled=!1}))}},render:function(){var t=this;return u("div",{class:_},[u("div",{class:v},[u("span",null,[r("优惠券")]),u("i",{class:y,onClick:function(){return t.$emit("close")}},null)]),u("div",{class:C},[this.dataLoading?u(a,{size:48,color:"#2dc7aa",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:function(){return[r("加载中...")]}}):u(i,null,[this.list.length>0?u(i,null,[this.list.map((function(e){return u(m,{item:e,isSelect:!0,onClick:t.onSelect},null)}))]):u(c,{btnStatus:!1,tips:"暂无优惠券",classImgSize:"SMALL"},null)])]),u("div",{class:[b,"van-hairline--top"]},[u("div",{class:L},[r("已选"),u("span",null,[this.useLength]),r("张")]),u(s,{type:"primary",round:!0,class:"tenant"===l.projectType&&S,style:{minWidth:"105px",fontSize:"16px"},onClick:this.onSubmit},{default:function(){return[r("确定")]}})])])}}),k={UNIVERSAL:"UNIVERSAL",VIP:"VIP",PIANO_ROOM:"PIANO",GOODS:"MALL",MUSIC:"MUSIC",PRACTICE:"SPARRING",LIVE:"LIVE",VIDEO:"VIDEO",ALBUM:"ALBUM"};e("U",n({name:"use-conpon",props:{disabled:{type:Boolean,default:!1},orderAmount:{type:Number,default:0},orderType:{type:String,default:""},discountPrice:{type:Number,default:0}},emits:["couponSelect"],data:function(){return{popupStatus:!1,popupLoading:!1,useCouponList:[],useCouponLoading:!1,useCouponCount:0,dataLoading:!1,list:[]}},computed:{couponCount:function(){var t=this.useCouponList.map((function(t){return Number(t.discountPrice||0)}));return this.disabled?this.discountPrice:t.length>0?t.reduce((function(t,e){return t+e})):0},couponCategory:function(){return k[this.orderType]||"UNIVERSAL"}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;return o(regeneratorRuntime.mark((function e(){var n,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.dataLoading){e.next=2;break}return e.abrupt("return");case 2:return t.dataLoading=!0,e.prev=3,e.next=6,d.post("".concat(l.platformApi,"/couponInfo/page"),{data:{couponCategory:t.couponCategory,couponType:"FULL_DISCOUNT",useState:"USABLE",orderUse:1,page:1,rows:100}});case 6:if(n=e.sent,t.dataLoading=!1,o=n.data||{},!(t.list.length>0&&1===o.pageNo)){e.next=11;break}return e.abrupt("return");case 11:t.list=o.rows||[],t.list.forEach((function(e){e.checked=!1,e.useLimit>t.orderAmount?e.disabled=!0:e.disabled=!1})),u=0,t.list.forEach((function(t){t.disabled||u++})),t.useCouponCount=u,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]])})))()},onSubmit:function(t){this.useCouponList=t,this.$emit("couponSelect",t),this.popupStatus=!1,this.popupLoading=!1}},render:function(){var t=this;return u(i,null,[u(f,{title:"优惠券",class:g,style:{borderRadius:"8px"},isLink:!this.disabled,clickable:!1,onClick:function(){t.disabled||(t.popupStatus=!0,t.popupLoading=!0)}},{value:function(){return!t.useCouponLoading&&u(i,null,[t.couponCount>0?u("span",{class:A},[u("i",null,[r("-¥")]),t.couponCount]):u(i,null,[t.useCouponCount>0?"".concat(t.useCouponCount,"张可使用"):"暂无可使用优惠券"])])}}),u(p,{show:this.popupStatus,"onUpdate:show":function(e){return t.popupStatus=e},position:"bottom",round:!0,safeAreaInsetBottom:!0,style:{height:"75%"},onClosed:function(){t.popupLoading=!1}},{default:function(){return[t.popupLoading&&u(I,{couponCategory:t.couponCategory,useCoupon:t.useCouponList,orderAmount:t.orderAmount,couponList:t.list,onClose:function(){return t.popupStatus=!1},onSubmit:function(e){return t.onSubmit(e)}},null)]}})])}}))}}}))}();