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.fb8d6c34.js","./index-legacy.b2528a15.js","./index-legacy.4f922f18.js","./index-legacy.3f4943f0.js","./index-legacy.7e6f30e7.js","./item-legacy.b1c9ebd5.js","./index-legacy.9cbe7ce8.js","./use-id-legacy.4f071235.js","./use-tab-status-legacy.5c2c2da3.js","./use-refs-legacy.2f8acfce.js"],(function(n){"use strict";var i,o,u,c,s,l,f,p,d,g,b,h,y,m;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,b=t.a},function(t){h=t.s,y=t.I},function(t){m=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(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 s(y,{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:h.coupons},[s(g,{color:"#2DC7AA",lineWidth:44,sticky:!0},{default:function(){return[s(b,{title:"可使用".concat(t.couponCount.total>0?"("+t.couponCount.total+"张)":"")},{default:function(){return[s(S,null,null)]}}),s(b,{title:"已使用"},{default:function(){return[s(S,{useState:"USED"},null)]}}),s(b,{title:"已失效"},{default:function(){return[s(S,{useState:"EXPIRED"},null)]}})]}})])}}))}}}))}();
|