董佳音

动态创建管理员列表

@@ -60,6 +60,7 @@ class AdministratorApe extends Ape { @@ -60,6 +60,7 @@ class AdministratorApe extends Ape {
60 constructor() { 60 constructor() {
61 super(); 61 super();
62 this.classDateList = {};//课堂的所有数据 62 this.classDateList = {};//课堂的所有数据
  63 + this.pageNo = 0;
63 this.addEvent(); 64 this.addEvent();
64 this.init(); 65 this.init();
65 } 66 }
@@ -80,7 +81,7 @@ class AdministratorApe extends Ape { @@ -80,7 +81,7 @@ class AdministratorApe extends Ape {
80 } 81 }
81 //首页 82 //首页
82 _homePageHandler(){ 83 _homePageHandler(){
83 - 84 + this._pageNumBtnHandler(1);
84 } 85 }
85 //上页 86 //上页
86 _upPageHandler(){ 87 _upPageHandler(){
@@ -92,7 +93,7 @@ class AdministratorApe extends Ape { @@ -92,7 +93,7 @@ class AdministratorApe extends Ape {
92 } 93 }
93 //尾页 94 //尾页
94 _endPageHandler(){ 95 _endPageHandler(){
95 - 96 + this._pageNumBtnHandler(this.pageNo);
96 } 97 }
97 //指定页 98 //指定页
98 _assignPageHandler(){ 99 _assignPageHandler(){
@@ -103,27 +104,27 @@ class AdministratorApe extends Ape { @@ -103,27 +104,27 @@ class AdministratorApe extends Ape {
103 } 104 }
104 105
105 //点击翻页 106 //点击翻页
106 - _pageNumBtnHandler(evt){ 107 + _pageNumBtnHandler(ind){
107 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting'; 108 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting';
108 - let _ele = $(evt.target); 109 + // let _ele = $(evt.target);
109 let that = this; 110 let that = this;
110 - if(_ele.siblings().length > 1 ){ 111 + if(this.pageNo > 2 ){
111 // _ele.addClass('pageNumBtnCheck').siblings().removeClass('pageNumBtnCheck'); 112 // _ele.addClass('pageNumBtnCheck').siblings().removeClass('pageNumBtnCheck');
112 $.ajax({ 113 $.ajax({
113 type: "POST", 114 type: "POST",
114 url: _url, 115 url: _url,
115 - headers: {'page':_ele.text(),  
116 - siteId:'markettest', 116 + data:{siteId:'markettest'},
  117 + headers: {'page':ind,
117 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo', 118 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo',
118 }, 119 },
119 120
120 success:function(_data){ 121 success:function(_data){
121 if(_data != 200 ){ 122 if(_data != 200 ){
122 // loger.warn(_data.data.msg) 123 // loger.warn(_data.data.msg)
  124 + return;
123 } 125 }
124 that.classDateList = _data.returnData.data; 126 that.classDateList = _data.returnData.data;
125 - //切换列表内容  
126 - that._classDateContent(that.classDateList); 127 + that._gainClassData(_data.returnData.data);
127 loger.log(_data,'成功') 128 loger.log(_data,'成功')
128 }, 129 },
129 error:function(error){ 130 error:function(error){
@@ -164,6 +165,7 @@ class AdministratorApe extends Ape { @@ -164,6 +165,7 @@ class AdministratorApe extends Ape {
164 let page = _data.page; 165 let page = _data.page;
165 let pageno = _data.pageno; 166 let pageno = _data.pageno;
166 let _dataList = _data.meetingInfo; 167 let _dataList = _data.meetingInfo;
  168 + this.pageNo = pageno;
167 $('#classHandlerPageMsg').html('第'+page+'页/共'+pageno+'页,有'+count+'个记录'); 169 $('#classHandlerPageMsg').html('第'+page+'页/共'+pageno+'页,有'+count+'个记录');
168 courseContent.append(adminListTit); 170 courseContent.append(adminListTit);
169 if(_dataList){ 171 if(_dataList){
@@ -164,10 +164,11 @@ class CreateClassApe extends Ape { @@ -164,10 +164,11 @@ class CreateClassApe extends Ape {
164 let dateList = this.classDateList; 164 let dateList = this.classDateList;
165 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/createMeeting'; 165 let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/createMeeting';
166 let userName = window.localStorage.getItem('loginName'); 166 let userName = window.localStorage.getItem('loginName');
  167 + let userType = window.localStorage.getItem('userType');
167 dateList.siteId = 'markettest'; 168 dateList.siteId = 'markettest';
168 dateList.userId = '123'; 169 dateList.userId = '123';
169 dateList.userName = userName; 170 dateList.userName = userName;
170 - dateList.userType = 1; 171 + dateList.userType = userType;
171 172
172 let that = this; 173 let that = this;
173 $.ajax({ 174 $.ajax({
@@ -232,6 +232,7 @@ class LoginOrRegister extends Ape { @@ -232,6 +232,7 @@ class LoginOrRegister extends Ape {
232 that.successLogin(_data); 232 that.successLogin(_data);
233 window.localStorage.setItem("loginName",_name.value); 233 window.localStorage.setItem("loginName",_name.value);
234 window.localStorage.setItem("password", _passWord.value); 234 window.localStorage.setItem("password", _passWord.value);
  235 + window.localStorage.setItem("userType", _data.returnData.data.userType);
235 window.localStorage.setItem("token",_data.returnData.data.token); 236 window.localStorage.setItem("token",_data.returnData.data.token);
236 } 237 }
237 }, 238 },