Add: maestro_info
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
class MaestroInfo {
|
||||
|
||||
constructor() {
|
||||
this.maestroID = sessionStorage.getItem("maestroID");
|
||||
this.maestroName = "";
|
||||
this.accountType = 0;
|
||||
this.playerCount = 0;
|
||||
}
|
||||
|
||||
loadMaestroInfo(onSuccess, onFail) {
|
||||
let self = this;
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/maestro/maestro_info.php",
|
||||
"maestro_id=" + this.maestroID,
|
||||
|
||||
(jsonData) => {
|
||||
self.maestroName = jsonData["name"];
|
||||
self.accountType = jsonData["accountType"];
|
||||
self.playerCount = jsonData["playerCount"];
|
||||
|
||||
onSuccess();
|
||||
},
|
||||
|
||||
(errorMessage, errorCode) => {
|
||||
onFail(errorMessage, errorCode);
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
getMaxPlayerCount() {
|
||||
switch(this.accountType) {
|
||||
case 1:
|
||||
return 20;
|
||||
case 2:
|
||||
return 50;
|
||||
case 3:
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
|
||||
getRegisteredPlayerCount() {
|
||||
return this.playerCount;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
loadAddPlayerListPage(pageNo) {
|
||||
self = this;
|
||||
let self = this;
|
||||
this.activePageNo = pageNo;
|
||||
|
||||
let pageIndex = pageNo - 1;
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
|
||||
updateAddPlayerListPage(pageNo) {
|
||||
self = this;
|
||||
let self = this;
|
||||
this.playerListPage = pageNo;
|
||||
|
||||
let pageIndex = pageNo - 1;
|
||||
@@ -149,6 +149,8 @@
|
||||
|
||||
|
||||
onClickPlayerListPage(pageNo) {
|
||||
let self = this;
|
||||
|
||||
switch(pageNo) {
|
||||
case "first":
|
||||
this.activePageNo = 1;
|
||||
@@ -178,6 +180,7 @@
|
||||
|
||||
|
||||
editPlayer(inputButton) {
|
||||
let self = this;
|
||||
// console.log(inputButton);
|
||||
let clickedObjectID = this.getClickedObjectID(inputButton);
|
||||
|
||||
@@ -238,6 +241,8 @@
|
||||
let playerName = $("#search_name").val();
|
||||
self.setupSearchPlayerList(playerName);
|
||||
}
|
||||
|
||||
onChangePlayerCount();
|
||||
},
|
||||
|
||||
(errorMessage, errorCode) => {
|
||||
|
||||
Reference in New Issue
Block a user