📄 wm_msg.js
字号:
jspp.using("mocom.WAPmo.Kernel");
jspp.using("mocom.WAPmo.OptionCard");
jspp.Msg = {
page : 0,
keyword : null,
doPage : function(page)
{
jspp.Msg.page = page;
MessageBox.show(MSG_WAITING, "正在获取短信息列表……");
var rpc = new xmlrpc();
rpc.setData("Handle", "list");
if (jspp.Msg.keyword && jspp.Msg.keyword != "") rpc.setData("Keyword", jspp.Msg.keyword);
rpc.setData("Page", page);
rpc.callBack = function()
{
var http = rpc.http;
if (http.readyState == 4)
{
if (http.status == 200)
{
MessageBox.close();
document.getElementById("_list_").innerHTML = http.responseText;
}
else
{
MessageBox.write("获取短信息列表错误:" + http.responseText);
MessageBox.setType(MSG_WARNING);
}
}
};
rpc.doGet("admin_msg.asp", true);
},
query : function(frm)
{
jspp.Msg.keyword = frm.Keyword.value;
jspp.Msg.doPage(0);
},
control : function(obj, id)
{
switch (atol(obj.value))
{
case 0:
break;
case 1:
jspp.Msg.remove(id);
break;
}
obj.selectedIndex = 0;
},
getChecked : function(frm)
{
var ptr = frm.getElementsByTagName("INPUT");
var arr = new Array();
for (var i = 0; i < ptr.length; i++)
{
if (ptr[i].id == "SeqId" && ptr[i].checked == true)
{
arr.push(ptr[i].value);
}
}
return(arr);
},
remove : function(id)
{
MessageBox.show(MSG_CONFIRM, "您确定要删除该短信息么?");
MessageBox.doAccept(function()
{
jspp.Msg.doRemove(id);
}, true);
},
doRemove : function(id)
{
MessageBox.show(MSG_WAITING, "初始化服务请求……");
var rpc = new xmlrpc();
rpc.setData("SeqId", id);
rpc.callBack = function()
{
var http = rpc.http;
switch (http.readyState)
{
case 1:
MessageBox.write("正在连接服务程序……");
break;
case 2:
MessageBox.write("已连接服务程序……");
break;
case 3:
MessageBox.write("正在返回状态报告……");
break;
case 4:
var ret = http.responseText;
if (ret == "OK")
{
MessageBox.write("<font color=\"#0000FF\">短信息删除成功</font>");
MessageBox.setType(MSG_HINT);
MessageBox.doAccept(function()
{
jspp.Msg.doPage(jspp.Msg.page);
}, true);
}
else
{
MessageBox.write("<font color=\"#FF0000\">短信息删除失败:" + ret + "</font>");
MessageBox.setType(MSG_WARNING);
}
rpc.close();
rpc = null;
break;
}
};
rpc.doPost("admin_msg.asp?Handle=remove", true);
},
removeAll : function(frm)
{
var arr = jspp.Msg.getChecked(frm);
if (arr.length == 0)
{
MessageBox.show(MSG_WARNING, "请选择您要删除的短信息");
return;
}
MessageBox.show(MSG_CONFIRM, "您确定要删除所有选定的短信息么?");
MessageBox.doAccept(function()
{
jspp.Msg.doRemove(arr.join(","));
}, true);
},
getReply : function(id)
{
MessageBox.show(MSG_WAITING, "正在获取短信息列表……");
var rpc = new xmlrpc();
rpc.setData("Handle", "replys");
rpc.setData("SeqId", id);
rpc.callBack = function()
{
var http = rpc.http;
if (http.readyState == 4)
{
if (http.status == 200)
{
MessageBox.close();
document.getElementById("Reply" + id).innerHTML = http.responseText;
}
else
{
MessageBox.write("获取短信息列表错误:" + http.responseText);
MessageBox.setType(MSG_WARNING);
}
}
};
rpc.doGet("admin_msg.asp", true);
}
};
window.onload = function()
{
var opt = new OptionCard();
opt.add("短信息管理");
opt.make(document.body, 5, 5);
opt.callBack[0] = function()
{
jspp.Msg.doPage(jspp.Msg.page);
};
opt.lock(0);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -