;(function(){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);});};}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._videoClass_1udm0_1 .van-list__loading,._videoClass_1udm0_1 .van-list__finished-text,._videoClass_1udm0_1 .van-list__error-text{width:100%}._videoClass_1udm0_1 .van-sticky--fixed{box-shadow:.26667rem .26667rem .26667rem var(--box-shadow-color)}._videoClass_1udm0_1 ._label_1udm0_9{margin-right:.21333rem;font-size:.37333rem}._videoClass_1udm0_1 ._label_1udm0_9 .van-list__loading,._videoClass_1udm0_1 ._label_1udm0_9 .van-list__finished-text,._videoClass_1udm0_1 ._label_1udm0_9 .van-list__error-text{width:100%}._videoClass_1udm0_1 ._label_1udm0_9 .iconfont-down{margin-left:.10667rem}._videoClass_1udm0_1 ._classHeader_1udm0_21{background:linear-gradient(#59e5d5,30%,#ffffff)}._videoClass_1udm0_1 ._banner_1udm0_24{background:#fff;padding:.32rem .37333rem}._videoClass_1udm0_1 ._videoList_1udm0_28{display:flex;justify-content:space-between;flex-wrap:wrap;padding:.37333rem}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.1bb96d98.js','./index-legacy.edec5e29.js','./vendor-legacy.031e1374.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a6.js','./video-item-legacy.e72544fd.js','./banner-legacy.b608ea80.js','./index-legacy.1cd7b6bb.js','./organ-search-legacy.28bb6854.js','./index-legacy.f25f109a8.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a3.js','./icon_teacher-legacy.42ba77b1.js','./index-legacy.f25f109a10.js'],function(exports){'use strict';var ColHeader,ColSearch,defineComponent,createVNode,Sticky,Icon,Image,List,isVNode,Popup,VideoItem,banner$1,state,request,ColResult,OrganSearch;return{setters:[function(module){ColHeader=module.C;},function(module){ColSearch=module.C;},function(module){defineComponent=module.d;createVNode=module.a;Sticky=module.S;Icon=module.u;Image=module.I;List=module.w;isVNode=module.x;Popup=module.P;},function(){},function(){},function(){},function(module){VideoItem=module.V;},function(module){banner$1=module.b;},function(module){state=module.s;request=module.r;ColResult=module.C;},function(module){OrganSearch=module.O;},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var videoClass="_videoClass_1udm0_1";var label="_label_1udm0_9";var classHeader="_classHeader_1udm0_21";var banner="_banner_1udm0_24";var videoList="_videoList_1udm0_28";var styles={videoClass:videoClass,label:label,classHeader:classHeader,banner:banner,videoList:videoList};function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var index=exports('default',defineComponent({name:'VideoClass',data:function data(){var _state$user$data;var sessionSubjectId=sessionStorage.getItem('videoClassSubjectId');return{search:'',list:[],dataShow:true,// 判断是否有数据
loading:false,finished:false,sessionSubjectId:sessionSubjectId,params:{search:'',lessonSubject:sessionSubjectId||((_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.subjectId)||null,subjectName:'',page:1,rows:20},searchStatus:false,openStatus:false,subjectList:[]};},mounted:function mounted(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var _state$user$data2;var res,subjectName;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return request.get('/api-student/subject/subjectSelect');case 3:res=_context.sent;_this.subjectList=res.data||[];_context.next=9;break;case 7:_context.prev=7;_context.t0=_context["catch"](0);case 9:subjectName='';_this.subjectList.forEach(function(item){var _item$subjects;(_item$subjects=item.subjects)===null||_item$subjects===void 0?void 0:_item$subjects.forEach(function(child){if(child.id===Number(_this.sessionSubjectId)){subjectName=child.name;}});});_this.params.subjectName=subjectName||((_state$user$data2=state.user.data)===null||_state$user$data2===void 0?void 0:_state$user$data2.subjectName)||'';sessionStorage.removeItem('videoClassSubjectId');case 13:case"end":return _context.stop();}}},_callee,null,[[0,7]]);}))();},methods:{getList:function getList(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var params,res,result;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;params=_objectSpread({},_this2.params);if(state.version){params.version=state.version||'';// 处理ios审核版本
params.platform='ios-student';}_context2.next=5;return request.post('/api-student/videoLesson/selectGroup',{data:_objectSpread({},params)});case 5:res=_context2.sent;_this2.loading=false;result=res.data||{};console.log(result);// 处理重复请求数据
if(!(_this2.list.length>0&&result.pageNo===1)){_context2.next=11;break;}return _context2.abrupt("return");case 11:_this2.list=_this2.list.concat(result.rows||[]);_this2.finished=result.pageNo>=result.totalPage;_this2.params.page=result.pageNo+1;_this2.dataShow=_this2.list.length>0;_context2.next=21;break;case 17:_context2.prev=17;_context2.t0=_context2["catch"](0);_this2.dataShow=false;_this2.finished=true;case 21:case"end":return _context2.stop();}}},_callee2,null,[[0,17]]);}))();},onSort:function onSort(){this.params.page=1;this.list=[];this.dataShow=true;// 判断是否有数据
this.loading=false;this.finished=false;this.searchStatus=false;this.getList();},onSearch:function onSearch(val){this.params.search=val;this.onSort();},onDetail:function onDetail(item){this.$router.push({path:'/videoDetail',query:{groupId:item.id}});}},render:function render(){var _this3=this;var _slot;return createVNode("div",{"class":styles.videoClass},[createVNode(Sticky,{"offsetTop":0,"position":"top"},{default:function _default(){return[createVNode(ColHeader,{"class":styles.classHeader,"border":false,"isFixed":false,"background":"transparent"},null),createVNode(ColSearch,{"placeholder":"请输入老师名称/课程名称","onSearch":_this3.onSearch},{left:function left(){return createVNode("div",{"class":styles.label,"onClick":function onClick(){_this3.searchStatus=!_this3.searchStatus;_this3.openStatus=!_this3.openStatus;}},[_this3.params.subjectName,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":12,"color":"#333"},null)]);}})];}}),createVNode("div",{"class":styles.banner},[createVNode(Image,{"src":banner$1},null)]),createVNode("div",null,[this.dataShow?createVNode(List,{"class":styles.videoList,"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this3.loading=$event;},"finished":this.finished,"finishedText":"没有更多了","onLoad":this.getList},_isSlot(_slot=this.list.map(function(item){return createVNode(VideoItem,{"item":item,"onClick":_this3.onDetail},null);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"tips":"暂无视频课"},null)]),createVNode(Popup,{"show":this.searchStatus,"position":"bottom","round":true,"closeable":true,"safe-area-inset-bottom":true,"onClose":function onClose(){return _this3.searchStatus=false;},"onClosed":function onClosed(){return _this3.openStatus=false;}},{default:function _default(){return[_this3.openStatus&&createVNode(OrganSearch,{"subjectList":_this3.subjectList,"onSort":_this3.onSort,"modelValue":_this3.params.lessonSubject,"onUpdate:modelValue":function onUpdateModelValue($event){return _this3.params.lessonSubject=$event;},"subjectName":_this3.params.subjectName,"onUpdate:subjectName":function onUpdateSubjectName($event){return _this3.params.subjectName=$event;}},null)];}})]);}}));}};});})();
