;(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;i0&&createVNode(Fragment,null,[createVNode("i",null,[createTextVNode("\xA5"),_this.item.subjectPrice]),createTextVNode("/")]),_this.item.courseMinutes,createTextVNode("\u5206\u949F")])])])]);}});}});function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var actions=[{name:'不限制',value:'',color:'var(--van-primary)'},{name:'单价最高',value:'subjectPrice DESC',color:'#333'},{name:'单价最低',value:'subjectPrice ASC',color:'#333'},{name:'课时数最多',value:'expTime DESC',color:'#333'},{name:'评分最高',value:'starGrade DESC',color:'#333'}];var index=exports('default',defineComponent({name:'practiceClass',data:function data(){return{openStatus:false,searchStatus:false,subjectList:[],list:[],dataShow:true,// 判断是否有数据 loading:false,finished:false,searchType:'organ',tempSort:{starGrade:'ALL',expTime:'ALL',subjectPrice:'ALL'},dataLoading:false,params:{search:'',sort:'',subjectName:'',isScreen:false,subjectId:null,page:1,rows:20},show:false,height:'auto'};},mounted:function mounted(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var _state$user$data,_state$user$data2;var res,_useRect,height;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_this2.params.subjectId=((_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.subjectId)||null;_this2.params.subjectName=((_state$user$data2=state.user.data)===null||_state$user$data2===void 0?void 0:_state$user$data2.subjectName)||'';_context.prev=2;_context.next=5;return request.get('/api-student/subject/subjectSelect');case 5:res=_context.sent;_this2.subjectList=res.data||[];_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](2);case 11:_useRect=useRect(_this2.$refs.headers),height=_useRect.height;_this2.height=height;_this2.getList();case 14:case"end":return _context.stop();}}},_callee,null,[[2,9]]);}))();},methods:{onSearch:function onSearch(_search){this.params.search=_search;this.onSort();},onSort:function onSort(){this.params.page=1;this.list=[];this.dataShow=true;// 判断是否有数据 this.loading=false;this.finished=false;this.searchStatus=false;this.getList();},onSheetSelect:function onSheetSelect(item){actions.forEach(function(v){v.color='#333';if(v.value===item.value){v.color='var(--van-primary)';}});this.params.sort=item.value;this.show=false;this.onSort();},getList:function getList(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var res,result;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;if(!_this3.dataLoading){_context2.next=3;break;}return _context2.abrupt("return");case 3:_this3.dataLoading=true;_context2.next=6;return request.post('/api-student/courseSchedule/teacherList',{data:_objectSpread({},_this3.params)});case 6:res=_context2.sent;_this3.dataLoading=false;_this3.loading=false;result=res.data||{};// 处理重复请求数据 if(!(_this3.list.length>0&&result.pageNo===1)){_context2.next=12;break;}return _context2.abrupt("return");case 12:_this3.list=_this3.list.concat(result.rows||[]);_this3.finished=result.pageNo>=result.totalPage;_this3.params.page=result.pageNo+1;_this3.dataShow=_this3.list.length>0;_context2.next=22;break;case 18:_context2.prev=18;_context2.t0=_context2["catch"](0);_this3.dataShow=false;_this3.finished=true;case 22:case"end":return _context2.stop();}}},_callee2,null,[[0,18]]);}))();}},render:function render(){var _this4=this;var _slot;return createVNode("div",{"style":{overflow:'hidden',minHeight:'100vh'}},[createVNode(Sticky,{"class":'sticky',"offsetTop":0,"style":{background:'var(--van-primary)',height:this.height+'px !important',width:'100%'}},{default:function _default(){return[createVNode("div",{"ref":"headers"},[createVNode(ColHeader,{"title":"陪练课","isFixed":false,"border":false,"backIconColor":"white","background":"var(--van-primary)","color":"#fff"},null),createVNode(ColSearch,{"placeholder":"请输入老师名称","inputBackground":"white","background":"var(--van-primary)","onSearch":_this4.onSearch},null),createVNode("div",{"class":styles$1.filterSection},[createVNode("div",null,[createVNode(Button,{"class":[styles$1.btn],"type":"primary","size":"small","round":true,"plain":true,"onClick":function onClick(){_this4.searchStatus=!_this4.searchStatus;_this4.openStatus=!_this4.openStatus;_this4.searchType='organ';}},{default:function _default(){return[_this4.params.subjectName,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":8,"style":{marginLeft:'4px'},"color":"var(--van-primary)"},null)];}}),createVNode(Button,{"class":[styles$1.btn],"size":"small","type":_this4.params.isScreen?'primary':'default',"round":true,"plain":true,"onClick":function onClick(){_this4.params.isScreen=!_this4.params.isScreen;_this4.onSort();}},{default:function _default(){return[createTextVNode("30\u5929\u5185\u672A\u7EA6\u6EE1")];}})]),createVNode("div",null,[createVNode("div",{"class":styles$1.dataItem,"onClick":function onClick(){_this4.show=true;}},[createTextVNode("\u7B5B\u9009"),createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":8,"style":{marginLeft:'4px'},"color":"var(--van-primary)"},null)])])])])];}}),this.dataShow?createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this4.loading=$event;},"finished":this.finished,"finishedText":" ","immediateCheck":false,"class":[styles$1.practiceList,'mb12'],"onLoad":this.getList},_isSlot(_slot=this.list.map(function(item){return createVNode(PracticeItem,{"item":item,"onClick":function onClick(){_this4.$router.push({path:'/teacherHome',query:{teacherId:item.teacherId,tabs:'practice',subjectId:_this4.params.subjectId}});}},null);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无陪练老师"},null),createVNode(ActionSheet,{"show":this.show,"onUpdate:show":function onUpdateShow($event){return _this4.show=$event;},"actions":actions,"cancelText":"取消","onSelect":this.onSheetSelect,"closeOnClickAction":true,"onCancel":function onCancel(){return _this4.show=false;}},null),createVNode(Popup,{"show":this.searchStatus,"position":"bottom","round":true,"closeable":true,"safe-area-inset-bottom":true,"onClose":function onClose(){return _this4.searchStatus=false;},"onClosed":function onClosed(){return _this4.openStatus=false;}},{default:function _default(){return[_this4.searchType==='organ'&&_this4.openStatus&&createVNode(OrganSearch,{"subjectList":_this4.subjectList,"onSort":_this4.onSort,"modelValue":_this4.params.subjectId,"onUpdate:modelValue":function onUpdateModelValue($event){return _this4.params.subjectId=$event;},"subjectName":_this4.params.subjectName,"onUpdate:subjectName":function onUpdateSubjectName($event){return _this4.params.subjectName=$event;}},null)];}})]);}}));}};});})();