index-legacy.8d15fa32.js 4.4 KB

1
  1. !function(){var t=["params","list"];function e(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(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)&&(i[n]=t[n])}return i}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){i(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 i(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,i,o,a){try{var u=t[o](a),c=u.value}catch(s){return void n(s)}u.done?e(c):Promise.resolve(c).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function u(t){o(a,r,i,u,c,"next",t)}function c(t){o(a,r,i,u,c,"throw",t)}u(void 0)}))}}System.register(["./hooks-legacy.1d4168e3.js","./index-legacy.f8641610.js","./index-legacy.4ddb0119.js","./index-legacy.00d337cc.js","./index-legacy.a8de4840.js","./item-legacy.408891a4.js","./index-legacy.13f535d5.js","./use-id-legacy.30c2e9af.js","./use-tab-status-legacy.5d29085f.js","./use-refs-legacy.e503281e.js"],(function(n){"use strict";var i,o,u,c,s,l,f,p,d,g,h,y,m,b;return{setters:[function(t){i=t.b,o=t.u},function(t){u=t.d,c=t.s,s=t.i,l=t.C,f=t.F,p=t.$,d=t.e},function(){},function(){},function(t){g=t.T,h=t.a},function(t){y=t.s,m=t.I},function(t){b=t.L},function(){},function(){},function(){}],execute:function(){var S=u({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 a(regeneratorRuntime.mark((function o(){var a,u,s,l;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,i("".concat(c.platformApi,"/couponInfo/page"),r({params:n.params,list:n.list},n.listState));case 3:a=o.sent,u=a.params,s=a.list,l=e(a,t),n.params=u,n.list=s,n.listState=l,o.next=12;break;case 10:o.prev=10,o.t0=o.catch(0);case 12:case"end":return o.stop()}}),o,null,[[0,10]])})))()}},render:function(){var t,e,n=this;return s(f,null,[this.listState.dataShow?s(b,{loading:this.listState.loading,"onUpdate:loading":function(t){return n.listState.loading=t},finished:this.listState.finished,finishedText:" ",class:[this.list.length>0&&y.list],onLoad:this.getList,immediateCheck:!1},(e=t=this.list.map((function(t){return s(m,{item:t},null)})),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!p(e)?t:{default:function(){return[t]}})):s(l,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无优惠券"},null)])}});n("default",u({name:"coupon-container",data:function(){return{couponCount:{total:0,useState:"USABLE"}}},mounted:function(){var t=this;return a(regeneratorRuntime.mark((function e(){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="STUDENT"===c.platformType?"/api-student":"/api-teacher",e.next=4,d.get("".concat(n,"/couponInfo/statInfo"));case 4:r=e.sent,i=r.data||[],t.couponCount=i.find((function(t){return"USABLE"===t.useState})),console.log(i.find((function(t){return"USABLE"===t.useState}))),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:o("优惠券");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))()},render:function(){var t=this;return s("div",{class:y.coupons},[s(g,{color:"#2DC7AA",lineWidth:44,sticky:!0},{default:function(){return[s(h,{title:"可使用".concat(t.couponCount.total>0?"("+t.couponCount.total+"张)":"")},{default:function(){return[s(S,null,null)]}}),s(h,{title:"已使用"},{default:function(){return[s(S,{useState:"USED"},null)]}}),s(h,{title:"已失效"},{default:function(){return[s(S,{useState:"EXPIRED"},null)]}})]}})])}}))}}}))}();