";
G("dialogBody").innerHTML = openIframe + coverIframe;
} else if (this.config.contentType == 2) {
G("dialogBody").innerHTML = this.info.contentHtml;
} else if (this.config.contentType == 3) {
G("dialogBody").innerHTML = confirm;
Event.observe(G('dialogOk'), "click", this.forCallback.bindAsEventListener(this), false);
Event.observe(G('dialogCancel'), "click", this.close.bindAsEventListener(this), false);
} else if (this.config.contentType == 4) {
G("dialogBody").innerHTML = alert;
Event.observe(G('dialogYES'), "click", this.close.bindAsEventListener(this), false);
};
},
reBuild: function() {
G('dialogBody').height = G('dialogBody').clientHeight;
this.lastBuild();
},
show: function() {
this.hiddenSome();
this.middle();
if (this.config.isShowShadow) this.shadow();
},
forCallback: function() {
return this.info.callBack(this.info.parameter);
},
shadow: function() {
var oShadow = G('dialogBoxShadow');
var oDialog = G('dialogBox');
oShadow['style']['position'] = "absolute";
oShadow['style']['background'] = "#000";
oShadow['style']['display'] = "";
oShadow['style']['opacity'] = "0.2";
oShadow['style']['filter'] = "alpha(opacity=20)";
oShadow['style']['top'] = oDialog.offsetTop + this.info.shadowWidth;
oShadow['style']['left'] = oDialog.offsetLeft + this.info.shadowWidth;
oShadow['style']['width'] = oDialog.offsetWidth;
oShadow['style']['height'] = oDialog.offsetHeight;
},
middle: function() {
if (!this.config.isBackgroundCanClick) G('dialogBoxBG').style.display = '';
var oDialog = G('dialogBox');
oDialog['style']['position'] = "absolute";
oDialog['style']['display'] = '';
var sClientWidth = document.body.clientWidth;
var sClientHeight = document.body.clientHeight;
var sScrollTop = document.body.scrollTop;
var sleft = (document.body.clientWidth / 2) - (oDialog.offsetWidth / 2);
var iTop = -80 + (sClientHeight / 2 + sScrollTop) - (oDialog.offsetHeight / 2);
var sTop = iTop > 0 ? iTop: (sClientHeight / 2 + sScrollTop) - (oDialog.offsetHeight / 2);
if (sTop < 1) sTop = "20";
if (sleft < 1) sleft = "20";
oDialog['style']['left'] = sleft+"px";
oDialog['style']['top'] = sTop+"px";
},
reset: function() {
if (this.config.isReloadOnClose) {
top.location.reload();
};
this.close();
},
close: function() {
G('dialogBox').style.display = 'none';
if (!this.config.isBackgroundCanClick) G('dialogBoxBG').style.display = 'none';
if (this.config.isShowShadow) G('dialogBoxShadow').style.display = 'none';
G('dialogBody').innerHTML = '';
try{
//处理自定义重置函数
window.SumbitCancelHandler(this);
}catch(error){
}
this.showSome();
},
hiddenSome: function() {
var tag = this.info.someHiddenTag.split(",");
if (tag.length == 1 && tag[0] == "") tag.length = 0;
for (var i = 0; i < tag.length; i++) {
this.hiddenTag(tag[i]);
};
var ids = this.info.someHiddenEle.split(",");
if (ids.length == 1 && ids[0] == "") ids.length = 0;
for (var i = 0; i < ids.length; i++) {
this.hiddenEle(ids[i]);
};
space("begin");
},
hiddenTag: function(tagName) {
var ele = document.getElementsByTagName(tagName);
if (ele != null) {
for (var i = 0; i < ele.length; i++) {
if (ele[i].style.display != "none" && ele[i].style.visibility != 'hidden') {
ele[i].style.visibility = 'hidden';
this.someToHidden.push(ele[i]);
};
};
};
},
hiddenEle: function(id) {
var ele = document.getElementById(id);
if (typeof(ele) != "undefined" && ele != null) {
ele.style.visibility = 'hidden';
this.someToHidden.push(ele);
}
},
showSome: function() {
for (var i = 0; i < this.someToHidden.length; i++) {
this.someToHidden[i].style.visibility = 'visible';
};
space("end");
}
};
var Dragdrop = new Class();
Dragdrop.prototype = {
initialize: function(width, height, shadowWidth, showShadow, contentType) {
this.dragData = null;
this.dragDataIn = null;
this.backData = null;
this.width = width;
this.height = height;
this.shadowWidth = shadowWidth;
this.showShadow = showShadow;
this.contentType = contentType;
this.IsDraging = false;
this.oObj = G('dialogBox');
Event.observe(G('dialogBoxTitle'), "mousedown", this.moveStart.bindAsEventListener(this), false);
},
moveStart: function(event) {
this.IsDraging = true;
if (this.contentType == 1) {
G("iframeBG").style.display = "";
G("iframeBG").style.width = this.width;
G("iframeBG").style.height = this.height;
};
Event.observe(document, "mousemove", this.mousemove.bindAsEventListener(this), false);
Event.observe(document, "mouseup", this.mouseup.bindAsEventListener(this), false);
Event.observe(document, "selectstart", this.returnFalse, false);
this.dragData = {
x: Event.pointerX(event),
y: Event.pointerY(event)
};
this.backData = {
x: parseInt(this.oObj.style.left),
y: parseInt(this.oObj.style.top)
};
},
mousemove: function(event) {
if (!this.IsDraging) return;
var iLeft = Event.pointerX(event) - this.dragData["x"] + parseInt(this.oObj.style.left);
var iTop = Event.pointerY(event) - this.dragData["y"] + parseInt(this.oObj.style.top);
if (this.dragData["y"] < parseInt(this.oObj.style.top)) iTop = iTop - 12;
else if (this.dragData["y"] > parseInt(this.oObj.style.top) + 25) iTop = iTop + 12;
this.oObj.style.left = iLeft;
this.oObj.style.top = iTop;
if (this.showShadow) {
G('dialogBoxShadow').style.left = iLeft + this.shadowWidth;
G('dialogBoxShadow').style.top = iTop + this.shadowWidth;
};
this.dragData = {
x: Event.pointerX(event),
y: Event.pointerY(event)
};
document.body.style.cursor = "move";
},
mouseup: function(event) {
if (!this.IsDraging) return;
if (this.contentType == 1) G("iframeBG").style.display = "none";
document.onmousemove = null;
document.onmouseup = null;
var mousX = Event.pointerX(event) - (document.documentElement.scrollLeft || document.body.scrollLeft);
var mousY = Event.pointerY(event) - (document.documentElement.scrollTop || document.body.scrollTop);
if (mousX < 1 || mousY < 1 || mousX > document.body.clientWidth || mousY > document.body.clientHeight) {
this.oObj.style.left = this.backData["x"];
this.oObj.style.top = this.backData["y"];
if (this.showShadow) {
G('dialogBoxShadow').style.left = this.backData.x + this.shadowWidth;
G('dialogBoxShadow').style.top = this.backData.y + this.shadowWidth;
};
};
this.IsDraging = false;
document.body.style.cursor = "";
Event.stopObserving(document, "selectstart", this.returnFalse, false);
},
returnFalse: function() {
return false;
}
};
function selected_ept(subx, y) {
if (typeof(subx) == 'undefined') {
return;
}
var dx = new Array(3);
var dy = new Array(3);
dx = y.split("|");
for (var i = 0; i < subx.length; i++) {
dy = subx.options[i].value.split("|");
if (dy[0] == dx[0]) {
subx.selectedIndex = i;
break;
}
}
}
//打开窗口函数
function winopen(url,method,par){
if (par==null || par=="undefined") {par='';}
window.open(url,method,par);
}
//选择指定所有选项框对象
function SelectAllProCheck(obj,state){
for(var i=0;i0 && image.height>0)
{
if(image.width/image.height>= FitWidth/FitHeight)
{
if(image.width>FitWidth)
{
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else
{
if(image.height>FitHeight)
{
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
//var pop;
//function send_form(formobj,w, h,tt) {
// pop = new Popup({
// contentType: 1,
// isReloadOnClose: false,
// width: w,
// height: h
// });
// pop.setContent('title', tt);
// pop.build();
// formobj.target = pop.iframeIdName;
// formobj.submit();
// pop.show();
//};
function send_sms($data_parame){
if(!jQuery.jMessageBox){
alert("jQuery.jMessageBox Plug Error") ;
return
}
showWaitMsgbox("Loading...","正在操作,请稍后!")
try{
$.ajax({
url: "http://www.lkryton.cn/send_sms.asp",
type: 'POST',
data: $data_parame,
dataType: 'json',
timeout: 10000,
error: function(err){
alert("操作中出现未知错误,操作失败");
jQuery.jMessageBox.hide();
},
success: function(data){
if(data["status"]!="success"){
alert("操作失败"+data["error"]);
jQuery.jMessageBox.hide();
return;
}
jQuery.jMessageBox.show({
width : 350,
title : "操作提示",
message : "发送成功",
yesButton : {
click : function(){
jQuery.jMessageBox.hide();
}
},
});
}
});
}catch(e){
alert("脚本执行出现错误:"+e.message)
jQuery.jMessageBox.hide();
}
}
//获取手机验证码
var msg_lock_timer=0;
var interval_id;
function get_msg_code($target,$TemplateType){
if(msg_lock_timer>0){
return;
}
var mobile=$("#mobile").val();
if(mobile=="" || new String(mobile).length!=11){
alert("请输入手机号");
return;
}
$target.attr("disabled",true)
$.ajax({
url: "http://www.lkryton.cn/send_sms.asp",
type: 'POST',
data: { TemplateType: $TemplateType ,PhoneNumbers:mobile},
dataType: 'json',
timeout: 10000,
error: function(err){
$target.attr("disabled",false)
alert("操作中出现未知错误,操作失败");
},
success: function(data){
msg_lock_timer=60;
interval_id=window.setInterval(function(){
$target.val(msg_lock_timer+"秒之后重发")
msg_lock_timer--;
if(msg_lock_timer<=0){
$target.attr("disabled",false)
window.clearInterval(interval_id)
$target.val("获取手机验证码")
}
},1000)
//console.info(data)
}
});
}
function reg_user_name_check(el_name,default_val){
let el
if (typeof(el_name)=="string"){
el=el_name
}else{
el='user-reg-form'
}
if (typeof(default_val)!="string"){
default_val=''
}
var vue=new Vue({
el:'#'+el,
data:{
reg_user:default_val,
reg_user_check_result:''
},
methods:{
reg_user_check_handler:function(){
//alert(this.reg_user)
let that=this;
if(this.reg_user=='' || this.reg_user.length==0){
that.reg_user_check_result='请输入用户名'
return
}
that.reg_user_check_result="loading..."
$.ajax({
url: "http://www.lkryton.cn//userzc/regcheck.asp",
type: 'POST',
data: { "Do": "reg_username_check","reg_user":this.reg_user},
dataType: 'html',
timeout: 10000,
error: function(err){
alert("操作中出现未知错误,操作失败");
},
success: function(htmldata){
let jsondata=JSON.parse(htmldata)
console.info(jsondata)
if (jsondata['state']=="fail"){
that.reg_user_check_result=''+jsondata['error']+''
}else{
that.reg_user_check_result=''+jsondata['error']+''
}
}
});
},
},
})
}