⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shop_visual_edit.js

📁 设置POS机资料、班次资料、收银员资料等。   2)灵活、细分的权限管理
💻 JS
字号:
// JavaScript Document
//author woodzheng 2007-01-31, for paipai login plugin
document.domain = "paipai.com"; //for the sub domain paipai
function CLoginElf(objName){
	var objName = objName;
	var objLoginElf = this;
	var objContainer = document.createElement("DIV");
	var objContainerLogin = document.createElement("DIV");
	var objBody = null;
	var bShowStat = false;
	this.bHasInitShow = false;
	
	var WD_IS_IE            = (document.all?true:false);
	var WD_WIN_MAX_WIDTH  = WD_IS_IE?(screen.width  - 20):window.innerWidth;
	var WD_WIN_MAX_HEIGHT = WD_IS_IE?(screen.height - 250):window.innerHeight;	
	
	var SetClassName = function(obj,sClassName){
		obj.setAttribute("class",sClassName);
		obj.setAttribute("className",sClassName);		
	}
	
	var SetStyleString = function(obj,sStyleString){
		obj.setAttribute("style",sStyleString);
		obj.style.cssText = sStyleString;
	};	
	
	this.FloatAllWays = function(){
		if(!bShowStat){
			return;
		}
		var sTempStyleString = "top:"+document.documentElement.scrollTop+"px; left:0px;";
		sTempStyleString    += "width:"  + document.documentElement.clientWidth  + "px;";
		sTempStyleString    += "height:" + document.documentElement.offsetHeight  + "px;";	
		SetStyleString(objContainer,sTempStyleString);	
		
		SetStyleString(objContainerLogin,sTempStyleString);	
		/*
		var topPx = document.documentElement.scrollTop+100;
		var sTempStyleString = "margin-top:"+topPx+"px;";
		var loginiframe = document.getElementById("loginiframe");
		SetStyleString(loginiframe,sTempStyleString);	
		*/
	}		
	
	this.ShowErrInfo = function(errInfo){
		var objErrInfoContainer = document.getElementById("loginerrinfo");
		objErrInfoContainer.style.display = "";
		objErrInfoContainer.innerHTML = '&nbsp;&nbsp;&nbsp;<img src="http://pics.paipai.com/newsys/member/login_btn_notice.gif" hspace="6" align="middle" />'+errInfo;
	}
	
	this.HideErrInfo = function (){
		var objErrInfoContainer = document.getElementById("loginerrinfo");
		objErrInfoContainer.style.display = "none";
	}
	
	this.ShowLoginFrameAgain = function (){
		ShowLoginFrame();
	//	objContainer.style.display = "";
	//	objContainerLogin.style.display = "";
		bShowStat = true;
	}
	
	this.CheckIsInitShow = function (){
		return objLoginElf.bHasInitShow;
	}

	this.ShowLoginFrame = function(){
		bShowStat = true;
		objBody = document.getElementsByTagName("body")[0];		
		var sTempStyleString = "top:0px; left:0px;";
		sTempStyleString    += "width:"  + document.documentElement.clientWidth  + "px;";
		sTempStyleString    += "height:" + document.documentElement.offsetHeight  + "px;";		
		SetClassName(objContainer,"screendiv");
		SetStyleString(objContainer,sTempStyleString);
		SetClassName(objContainerLogin,"containlogin");

		var strHTML1='<div id="loginiframe" style="width:340px"><iframe scrolling="no" frameborder="0" style="z-index:-1;position:absolute;top:express(this.parentElement.offsetTop);left:express(this.parentElement.offsetLeft); width:express(this.parentElement.offsetWidth);height:50px;"></iframe><div class="loginHead" style="width:340px"><div class="logintext">操作提示<a href="javascript:'+objName+'.CloseLogin();"><img src="http://pics.paipai.com/newsys/bbs/loginclose.gif" border="0" align="absmiddle" vspace="6" style="margin-left:70px;margin-top:2px;" /></a></div></div><div class="loginerrinfo" style="display:none;width:340px" id="loginerrinfo"></div><div class="framestyle" style="width:340px">';
		var strHTML11='<div id="loginiframe" style="width:340px"><iframe scrolling="no" frameborder="0" style="z-index:-1;position:absolute;top:express(this.parentElement.offsetTop);left:express(this.parentElement.offsetLeft); width:express(this.parentElement.offsetWidth);height:50px;"></iframe><div class="loginHead" style="width:340px"><div class="logintext">操作提示</div></div><div class="loginerrinfo" style="display:none;width:340px" id="loginerrinfo"></div><div class="framestyle" style="width:340px">';
		var strHTML12='<div id="loginiframe" style="width:340px"><iframe scrolling="no" frameborder="0" style="z-index:-1;position:absolute;top:express(this.parentElement.offsetTop);left:express(this.parentElement.offsetLeft); width:express(this.parentElement.offsetWidth);height:50px;"></iframe><div class="loginHead" style="width:340px;"><div class="logintext" style="font-size:14px;font-weight:bold;">拍拍网-请您登录后继续刚才的操作<a href="javascript:'+objName+'.CloseLogin();"><img src="http://pics.paipai.com/newsys/bbs/loginclose.gif" border="0" align="absmiddle" vspace="6" style="margin-left:70px; margin-top:2px;" /></a></div></div><div class="loginerrinfo" style="display:none;width:340px" id="loginerrinfo"></div><div class="framestyle" style="width:340px">';
		var strHTML2='</div></div>';
		var strHTML3='<iframe src="http://www.paipai.com/ppalogin.html" width="100%" height="230" frameborder="0" id="pploginframe"></iframe>';
		var strHTML32='<iframe src="http://www.paipai.com/ppblogin.html" width="100%" height="250" frameborder="0" id="pploginframe"></iframe>';
		var strHTML4='<iframe src="http://www.paipai.com/mini_c2c_login.html" width="100%" height="230" frameborder="0" id="pploginframe"></iframe>';
		var strHTML="";
		switch(g_loginedFunType)
		{
			case 1:
				strHTML=strHTML1+strHTML3+strHTML2;
				break;
			case 2:
				strHTML=strHTML12+strHTML32+strHTML2;
				break;			
			case 3:
				strHTML=strHTML1+strHTML4+strHTML2;
				break;
			case 4:
				strHTML=strHTML1+g_sBackFunString+strHTML2;
				break;
			case 5:
				strHTML=strHTML11+g_sBackFunString+strHTML2;
				break;
			default:
				strHTML=strHTML1+strHTML3+strHTML2;
				break;
		}	
		objContainerLogin.innerHTML =strHTML;
		objBody.appendChild(objContainer);
		objBody.appendChild(objContainerLogin);		
		objLoginElf.bHasInitShow = true;
	}
	
	this.ShowLoginFrame1 = function(sBackStyle,sFrameStyle,sFrameContent){
		bShowStat = true;
		objBody = document.getElementsByTagName("body")[0];		
		var sTempStyleString = "top:0px; left:0px;";
		sTempStyleString    += "width:"  + document.documentElement.clientWidth  + "px;";
		sTempStyleString    += "height:" + document.documentElement.offsetHeight  + "px;";
		sTempStyleString    += sBackStyle;
//		SetClassName(objContainer,"screendiv");
		SetStyleString(objContainer,sTempStyleString);
		SetClassName(objContainerLogin,"containlogin");
		objContainerLogin.innerHTML =  '<div id="loginiframe" class="login_common" style="' +sFrameStyle+'"><span id="login_top"><img src="http://pics.paipai.com/member/login_bg_top.gif" /></span><div id="login_body"><span id="login_head">腾讯拍拍网-请您登录后继续刚才的操作<a href="javascript:'+objName+'.CloseLogin();"><img src="http://pics.paipai.com/member/login_ico_close.gif" align="top" border="0" style="margin:0 0 5px 80px" /></a></span><div class="loginerrinfo" style="display:none;" id="loginerrinfo"></div>'+ sFrameContent +'</div><span id="login_bot"><img src="http://pics.paipai.com/member/login_bg_bot.gif" /></span></div>';		
		objBody.appendChild(objContainer);
		objBody.appendChild(objContainerLogin);		
		objLoginElf.bHasInitShow = true;
	}
	
	
	this.LoginedEnd = function(){
		objContainer.style.display = "none";
		objContainerLogin.style.display = "none";
		this.HideErrInfo();
		bShowStat = false;
	}
	
	this.CloseLogin = function(){
		objContainer.style.display = "none";
		objContainerLogin.style.display = "none";
		this.HideErrInfo();
		bShowStat = false;
		if(g_LoginIntervalID != 0)
		{
				window.clearInterval(g_LoginIntervalID);
				g_LoginIntervalID = 0;
		}

	}	
}

var g_objLoginElf = new CLoginElf("g_objLoginElf");
var g_objLoginElfTmp = g_objLoginElf;

var g_loginedFunType = 0; // 0 for url, 1 for function obj , 2 for function name string 3 for c2clogin 4 for diy content
var g_sBackFunString = null;

//为免登录用收藏
var g_objLoginElf1 = new CLoginElf("g_objLoginElf1");
var g_objLoginElfTmp = g_objLoginElf;

var g_LoginIntervalID = 0 //用于刷新屏幕的事件id

//var g_innerHTML="";
function showpaipailogin(loginedFunType,sBackFunString){
	g_objLoginElf = g_objLoginElfTmp;
	
	g_loginedFunType = loginedFunType;
	g_sBackFunString = sBackFunString;	
	//if(g_objLoginElf.CheckIsInitShow()){		
	//	g_objLoginElf.ShowLoginFrameAgain();
//	}
//	else{
		g_objLoginElf.ShowLoginFrame();
		g_LoginIntervalID = window.setInterval("g_objLoginElf.FloatAllWays()",200);
	//}
}

function showpaipailogin1(loginedFunType,sBackFunString,sBackStyle,sFrameStyle,sFrameContent){
	g_loginedFunType = loginedFunType;
	g_sBackFunString = sBackFunString;	
	g_objLoginElf1.ShowLoginFrame1(sBackStyle,sFrameStyle,sFrameContent);
	g_objLoginElf1.FloatAllWays();
	g_objLoginElf = g_objLoginElf1; //将g_objLoginElf设置为g_objLoginElf1,方便关闭,之后会在sBackFunString函数中设置回来
}

function dopaipailogin(iRetCode){
	if(iRetCode == 0){
		
		g_objLoginElf.LoginedEnd();
		switch(g_loginedFunType) {
			case 0: //url
				window.location = g_sBackFunString;
				break;
			case 1: //function obj
				g_sBackFunString.call();
				break;
			case 2: //function string
				eval(g_sBackFunString);
				break;				
		}
	}
	else{
		g_objLoginElf.ShowErrInfo("登录错误,请重新登录。");
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -