123 |
- ;(function(){var _excluded=["params","list"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}System.register(['./index-legacy.4b2d517a.js','./vendor-legacy.73abbe39.js','./index-legacy.8581423a.js','./index-legacy.637f35562.js','./item-legacy.a918e11e.js'],function(exports){'use strict';var request,state,ColResult,defineComponent,createVNode,List$1,isVNode,Fragment,Tabs,Tab,styles,Item;return{setters:[function(module){request=module.r;state=module.s;ColResult=module.C;},function(module){defineComponent=module.d;createVNode=module.b;List$1=module.t;isVNode=module.v;Fragment=module.F;Tabs=module.y;Tab=module.z;},function(){},function(){},function(module){styles=module.s;Item=module.I;}],execute:function execute(){var lockLoad=false;var useList=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(url,params){var method,res,result,_args=arguments;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:method=_args.length>2&&_args[2]!==undefined?_args[2]:"POST";_context.prev=1;if(!lockLoad){_context.next=4;break;}return _context.abrupt("return",params);case 4:lockLoad=true;if(!(method==="POST")){_context.next=11;break;}_context.next=8;return request.post(url,{requestType:params.requestType||"json",data:_objectSpread({},params.params)});case 8:_context.t0=_context.sent;_context.next=14;break;case 11:_context.next=13;return request.get(url,{requestType:params.requestType||"json",params:_objectSpread({},params.params)});case 13:_context.t0=_context.sent;case 14:res=_context.t0;params.loading=false;result=res.data||{};params.list=params.list.concat(result.rows||[]);params.finished=result.pageNo>=result.totalPage;params.params.page=result.pageNo+1;params.dataShow=params.list.length>0;_context.next=27;break;case 23:_context.prev=23;_context.t1=_context["catch"](1);params.dataShow=false;params.finished=true;case 27:lockLoad=false;return _context.abrupt("return",params);case 29:case"end":return _context.stop();}}},_callee,null,[[1,23]]);}));return function useList(_x,_x2){return _ref.apply(this,arguments);};}();function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var List=defineComponent({name:'coupon-list',props:{useState:{type:String,default:'USABLE'}},data:function data(){return{list:[],listState:{dataShow:true,// 判断是否有数据
- loading:false,finished:false},params:{useState:this.useState,page:1,rows:20}};},mounted:function mounted(){this.getList();},methods:{getList:function getList(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var result,params,list,res;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return useList("".concat(state.platformApi,"/couponInfo/page"),_objectSpread({params:_this.params,list:_this.list},_this.listState));case 3:result=_context2.sent;params=result.params,list=result.list,res=_objectWithoutProperties(result,_excluded);_this.params=params;_this.list=list;_this.listState=res;_context2.next=12;break;case 10:_context2.prev=10;_context2.t0=_context2["catch"](0);case 12:case"end":return _context2.stop();}}},_callee2,null,[[0,10]]);}))();}},render:function render(){var _this2=this;var _slot;return createVNode(Fragment,null,[this.listState.dataShow?createVNode(List$1,{"loading":this.listState.loading,"onUpdate:loading":function onUpdateLoading($event){return _this2.listState.loading=$event;},"finished":this.listState.finished,"finishedText":" ","class":[this.list.length>0&&styles.list],"onLoad":this.getList,"immediateCheck":false},_isSlot(_slot=this.list.map(function(item){return createVNode(Item,{"item":item},null);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无优惠券"},null)]);}});var index=exports('default',defineComponent({name:'coupon-container',data:function data(){return{couponCount:{total:0,useState:'USABLE'}};},mounted:function mounted(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var url,res,result;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.prev=0;// 判断是哪个端
- url=state.platformType==='STUDENT'?'/api-student':'/api-teacher';_context3.next=4;return request.get("".concat(url,"/couponInfo/statInfo"));case 4:res=_context3.sent;result=res.data||[];_this3.couponCount=result.find(function(result){return result.useState==='USABLE';});console.log(result.find(function(result){return result.useState==='USABLE';}));_context3.next=12;break;case 10:_context3.prev=10;_context3.t0=_context3["catch"](0);case 12:case"end":return _context3.stop();}}},_callee3,null,[[0,10]]);}))();},render:function render(){var _this4=this;return createVNode("div",{"class":styles.coupons},[createVNode(Tabs,{"color":"#01C1B5","lineWidth":44,"sticky":true},{default:function _default(){return[createVNode(Tab,{"title":"\u53EF\u4F7F\u7528".concat(_this4.couponCount.total>0?'('+_this4.couponCount.total+'张)':'')},{default:function _default(){return[createVNode(List,null,null)];}}),createVNode(Tab,{"title":"已使用"},{default:function _default(){return[createVNode(List,{"useState":"USED"},null)];}}),createVNode(Tab,{"title":"已失效"},{default:function _default(){return[createVNode(List,{"useState":"EXPIRED"},null)];}})];}})]);}}));}};});})();
|