index-legacy.2bb22edb.js 4.4 KB

12
  1. !function(){var t=["params","list"];function e(t,e){if(null==t)return{};var n,r,a=function(t,e){if(null==t)return{};var n,r,a={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e,n,r,a,o,i){try{var u=t[o](i),c=u.value}catch(s){return void n(s)}u.done?e(c):Promise.resolve(c).then(r,a)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var i=t.apply(e,n);function u(t){o(i,r,a,u,c,"next",t)}function c(t){o(i,r,a,u,c,"throw",t)}u(void 0)}))}}System.register(["./index-legacy.fba2875c.js","./hooks-legacy.148eb332.js","./index-legacy.edb65d0c.js","./index-legacy.af00a324.js","./index-legacy.5aeab789.js","./item-legacy.bb13e4ca.js","./index-legacy.a7012d0a.js","./use-id-legacy.db87b112.js","./use-tab-status-legacy.8752ccde.js","./use-refs-legacy.2affcb61.js"],(function(n){"use strict";var a,o,u,c,s,l,f,p,d,g,b,h,y,m;return{setters:[function(t){a=t.d,o=t.g,u=t.j,c=t.C,s=t.F,l=t.Z,f=t.w},function(t){p=t.b,d=t.u},function(){},function(){},function(t){g=t.T,b=t.a},function(t){h=t.s,y=t.I},function(t){m=t.L},function(){},function(){},function(){}],execute:function(){var S=a({name:"coupon-list",props:{useState:{type:String,default:"USABLE"}},data:function(){return{list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{useState:this.useState,page:1,rows:20}}},mounted:function(){this.getList()},methods:{getList:function(){var n=this;return i(regeneratorRuntime.mark((function a(){var i,u,c,s;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,p("".concat(o.platformApi,"/couponInfo/page"),r({params:n.params,list:n.list},n.listState));case 3:i=a.sent,u=i.params,c=i.list,s=e(i,t),n.params=u,n.list=c,n.listState=s,a.next=12;break;case 10:a.prev=10,a.t0=a.catch(0);case 12:case"end":return a.stop()}}),a,null,[[0,10]])})))()}},render:function(){var t,e,n=this;return u(s,null,[this.listState.dataShow?u(m,{loading:this.listState.loading,"onUpdate:loading":function(t){return n.listState.loading=t},finished:this.listState.finished,finishedText:" ",class:[this.list.length>0&&h.list],onLoad:this.getList,immediateCheck:!1},(e=t=this.list.map((function(t){return u(y,{item:t},null)})),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!l(e)?t:{default:function(){return[t]}})):u(c,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无优惠券"},null)])}});n("default",a({name:"coupon-container",data:function(){return{couponCount:{total:0,useState:"USABLE"}}},mounted:function(){var t=this;return i(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="STUDENT"===o.platformType?"/api-student":"/api-teacher",e.next=4,f.get("".concat(n,"/couponInfo/statInfo"));case 4:r=e.sent,a=r.data||[],t.couponCount=a.find((function(t){return"USABLE"===t.useState})),console.log(a.find((function(t){return"USABLE"===t.useState}))),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:d("优惠券");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))()},render:function(){var t=this;return u("div",{class:h.coupons},[u(g,{color:"#2DC7AA",lineWidth:44,sticky:!0},{default:function(){return[u(b,{title:"可使用".concat(t.couponCount.total>0?"("+t.couponCount.total+"张)":"")},{default:function(){return[u(S,null,null)]}}),u(b,{title:"已使用"},{default:function(){return[u(S,{useState:"USED"},null)]}}),u(b,{title:"已失效"},{default:function(){return[u(S,{useState:"EXPIRED"},null)]}})]}})])}}))}}}))}();