董佳音

修改管理员首页跳转页码和修改创建课堂开始终止时间

@@ -61,6 +61,7 @@ class AdministratorApe extends Ape { @@ -61,6 +61,7 @@ class AdministratorApe extends Ape {
61 super(); 61 super();
62 this.classDateList = {};//课堂的所有数据 62 this.classDateList = {};//课堂的所有数据
63 this.pageNo = 0; 63 this.pageNo = 0;
  64 + this.presentInd = 0;
64 this.addEvent(); 65 this.addEvent();
65 this.init(); 66 this.init();
66 } 67 }
@@ -81,59 +82,60 @@ class AdministratorApe extends Ape { @@ -81,59 +82,60 @@ class AdministratorApe extends Ape {
81 } 82 }
82 //首页 83 //首页
83 _homePageHandler(){ 84 _homePageHandler(){
84 - this._pageNumBtnHandler(1); 85 + this.presentInd = 1;
  86 + this._pageNumBtnHandler(this.presentInd);
85 } 87 }
86 //上页 88 //上页
87 _upPageHandler(){ 89 _upPageHandler(){
88 - 90 + if(this.presentInd >1){
  91 + this.presentInd--;
  92 + this._pageNumBtnHandler(this.presentInd);
  93 + }
89 } 94 }
90 //下页 95 //下页
91 _downPageHandler(){ 96 _downPageHandler(){
92 - 97 + if(this.presentInd < this.pageNo){
  98 + this.presentInd++;
  99 + this._pageNumBtnHandler(this.presentInd);
  100 + }
93 } 101 }
94 //尾页 102 //尾页
95 _endPageHandler(){ 103 _endPageHandler(){
96 - this._pageNumBtnHandler(this.pageNo); 104 + this.presentInd = this.pageNo;
  105 + this._pageNumBtnHandler(this.presentInd);
97 } 106 }
98 //指定页 107 //指定页
99 _assignPageHandler(){ 108 _assignPageHandler(){
100 let inputVal = $('#classHandlerPageInfoInput').val(); 109 let inputVal = $('#classHandlerPageInfoInput').val();
101 - if(parseInt){  
102 - 110 + if(parseInt(inputVal) <= this.pageNo || parseInt(inputVal) >= 1 ){
  111 + this._pageNumBtnHandler(parseInt(inputVal));
103 } 112 }
104 } 113 }
105 114
106 //点击翻页 115 //点击翻页
107 _pageNumBtnHandler(ind){ 116 _pageNumBtnHandler(ind){
108 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting'; 117 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting';
109 - // let _ele = $(evt.target);  
110 let that = this; 118 let that = this;
111 - if(this.pageNo > 2 ){  
112 - // _ele.addClass('pageNumBtnCheck').siblings().removeClass('pageNumBtnCheck');  
113 - $.ajax({  
114 - type: "POST",  
115 - url: _url,  
116 - data:{siteId:'markettest'},  
117 - headers: {'page':ind,  
118 - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo',  
119 - },  
120 -  
121 - success:function(_data){  
122 - if(_data != 200 ){  
123 - // loger.warn(_data.data.msg)  
124 - return;  
125 - }  
126 - that.classDateList = _data.returnData.data;  
127 - that._gainClassData(_data.returnData.data);  
128 - loger.log(_data,'成功')  
129 - },  
130 - error:function(error){  
131 - console.log(error,'失败') 119 + $.ajax({
  120 + type: "POST",
  121 + url: _url,
  122 + data:{siteId:'markettest'},
  123 + headers: {'page':ind,
  124 + type:8,
  125 + 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo',
  126 + },
  127 + success:function(_data){
  128 + if(_data.code != 200 ){
  129 + loger.warn(_data.returnData.data.msg)
132 } 130 }
133 - })  
134 - }else{  
135 - return;  
136 - } 131 + that.classDateList = _data.returnData.data;
  132 + that._gainClassData(_data.returnData.data);
  133 + },
  134 + error:function(error){
  135 + console.log(error,'失败')
  136 + }
  137 + })
  138 +
137 } 139 }
138 detailPage(){ 140 detailPage(){
139 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting'; 141 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting';
@@ -25,7 +25,7 @@ class CreateClassApe extends Ape { @@ -25,7 +25,7 @@ class CreateClassApe extends Ape {
25 //判断列表在右侧时取消边距 25 //判断列表在右侧时取消边距
26 this._judgeListPlace(); 26 this._judgeListPlace();
27 $('#collectYes').hide(); 27 $('#collectYes').hide();
28 - 28 + //默认显示当前时间戳
29 this._showPresentTime(); 29 this._showPresentTime();
30 30
31 $('#createClassBtn').on('click',this._createClassBtnHandler.bind(this)); 31 $('#createClassBtn').on('click',this._createClassBtnHandler.bind(this));
@@ -53,7 +53,10 @@ class CreateClassApe extends Ape { @@ -53,7 +53,10 @@ class CreateClassApe extends Ape {
53 let month = (newDate.getMonth()+1)<10?'0'+(newDate.getMonth()+1):(newDate.getMonth()+1); 53 let month = (newDate.getMonth()+1)<10?'0'+(newDate.getMonth()+1):(newDate.getMonth()+1);
54 let date = newDate.getDate()<10?'0'+newDate.getDate():newDate.getDate(); 54 let date = newDate.getDate()<10?'0'+newDate.getDate():newDate.getDate();
55 let timer = newDate.getFullYear() + '-'+ month +'-'+ date; 55 let timer = newDate.getFullYear() + '-'+ month +'-'+ date;
  56 + let hours = newDate.getHours();
56 $('.createClassTime1').text(timer); 57 $('.createClassTime1').text(timer);
  58 + $("#meeting_starthour").find("option[value = '"+hours+"']").attr("selected","selected");
  59 + $('#meeting_endhour').find("option[value = '"+ (hours + 2) +"']").attr("selected","selected");
57 } 60 }
58 _judgeListPlace(){ 61 _judgeListPlace(){
59 let i=(i%4); 62 let i=(i%4);