<script type="text/javascript">
var GameActiveCode = {
pbatchId: 0,
GetActiveCodeDetail: function(controlId, spanNameShort) {
var ddlBatchId = document.getElementById(controlId).value
var callBack = function(resultContent) {
if (resultContent != null) {
var spanId = "lbPrizeContent" + spanNameShort;
document.getElementById(spanId).innerHTML = resultContent.value;
}
};
MyAjax.GetActiveCodeDetail(ddlBatchId, callBack);
},
CopyToClipboard: function(gameShortCopy) { //复制到剪切板
var copyContentId = "jhm_content" + gameShortCopy;
var clipBoardContent = document.getElementById(copyContentId).innerHTML;
if (window.clipboardData) {
window.clipboardData.setData("Text", clipBoardContent);
alert("文字已经复制到您的剪贴板中\r\n您可以使用Ctrl+v快捷键粘贴到需要的地方");
}
else {
alert("当前浏览器无法自动复制到剪贴板,请手动复制地址栏中的地址!");
}
},
ClosedctiveCodeDiv: function(gameShort1) {
var closediv = "jhm_show_" + gameShort1;
$GET(closediv).style.display = 'none';
},
GetGameActiveCode: function(gameShort, selectid) {
if (!checkLoginByCookie()) {
alert('请您先登录!');
return;
}
var jhmDivId = "jhm_content" + gameShort;
var divShowId = "jhm_show_" + gameShort;
$GET(divShowId).style.display = '';
var selectText;
var selcetItem = $GET(selectid);
for (var i = 0; i < selcetItem.length; i++) {
if (selcetItem[i].selected == true) {
selectText = selcetItem[i].innerHTML;
}
}
var batchId = GameActiveCode.pbatchId = $GET(selectid).value;
var GetGameActiveCodeCallBack = function(result) {
if (result) {
if (result.value.ReturnCode == -2) {
alert(result.value.ReturnMessage);
return false;
}
if (result.value.ReturnCode == 0) {
var msg = result.value.ReturnMessage;
if (msg != "") {
if (GameActiveCode.pbatchId == 4 || GameActiveCode.pbatchId == 6 || GameActiveCode.pbatchId == 10) {
var infos = info.split(',');
if (infos.length >= 2) {
document.getElementById(jhmDivId).innerHTML = "卡号:" + infos[0] + " 密码:" + infos[1];
}
else {
document.getElementById(jhmDivId).innerHTML = "获得激活码错误-2,请联系管理员。";
}
}
else {
document.getElementById(jhmDivId).innerHTML = msg;
return false;
}
}
else {
document.getElementById(jhmDivId).innerHTML = "激活码已全部发放";
return false;
};
}
}
else {
alert("获取游戏激活码失败!");
return false;
};
};
MyAjax.GetActiveCodeByBatchId(batchId, GetGameActiveCodeCallBack);
}
};
</script>
var GameActiveCode = {
pbatchId: 0,
GetActiveCodeDetail: function(controlId, spanNameShort) {
var ddlBatchId = document.getElementById(controlId).value
var callBack = function(resultContent) {
if (resultContent != null) {
var spanId = "lbPrizeContent" + spanNameShort;
document.getElementById(spanId).innerHTML = resultContent.value;
}
};
MyAjax.GetActiveCodeDetail(ddlBatchId, callBack);
},
CopyToClipboard: function(gameShortCopy) { //复制到剪切板
var copyContentId = "jhm_content" + gameShortCopy;
var clipBoardContent = document.getElementById(copyContentId).innerHTML;
if (window.clipboardData) {
window.clipboardData.setData("Text", clipBoardContent);
alert("文字已经复制到您的剪贴板中\r\n您可以使用Ctrl+v快捷键粘贴到需要的地方");
}
else {
alert("当前浏览器无法自动复制到剪贴板,请手动复制地址栏中的地址!");
}
},
ClosedctiveCodeDiv: function(gameShort1) {
var closediv = "jhm_show_" + gameShort1;
$GET(closediv).style.display = 'none';
},
GetGameActiveCode: function(gameShort, selectid) {
if (!checkLoginByCookie()) {
alert('请您先登录!');
return;
}
var jhmDivId = "jhm_content" + gameShort;
var divShowId = "jhm_show_" + gameShort;
$GET(divShowId).style.display = '';
var selectText;
var selcetItem = $GET(selectid);
for (var i = 0; i < selcetItem.length; i++) {
if (selcetItem[i].selected == true) {
selectText = selcetItem[i].innerHTML;
}
}
var batchId = GameActiveCode.pbatchId = $GET(selectid).value;
var GetGameActiveCodeCallBack = function(result) {
if (result) {
if (result.value.ReturnCode == -2) {
alert(result.value.ReturnMessage);
return false;
}
if (result.value.ReturnCode == 0) {
var msg = result.value.ReturnMessage;
if (msg != "") {
if (GameActiveCode.pbatchId == 4 || GameActiveCode.pbatchId == 6 || GameActiveCode.pbatchId == 10) {
var infos = info.split(',');
if (infos.length >= 2) {
document.getElementById(jhmDivId).innerHTML = "卡号:" + infos[0] + " 密码:" + infos[1];
}
else {
document.getElementById(jhmDivId).innerHTML = "获得激活码错误-2,请联系管理员。";
}
}
else {
document.getElementById(jhmDivId).innerHTML = msg;
return false;
}
}
else {
document.getElementById(jhmDivId).innerHTML = "激活码已全部发放";
return false;
};
}
}
else {
alert("获取游戏激活码失败!");
return false;
};
};
MyAjax.GetActiveCodeByBatchId(batchId, GetGameActiveCodeCallBack);
}
};
</script>