<%@ page language="C#" autoeventwireup="true" inherits="admin_wapNav, kfenlei" %><%@ Register Src="inc/adminTop.ascx" TagName="adminTop" TagPrefix="qth8" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>框分类信息系统 后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<%=sJs %>
<div align="center">
<div class="main" align="left">
<qth8:adminTop ID="AdminTop1" runat="server" />
<script src="js/colpick.js" type="text/javascript"></script>
<script type="text/javascript">
var obj;
var objInput;
function showNav(input)
{
objInput=input;
obj=layer.tab({
  area: ['800px', '400px'],
  tab: [<%=sSortList%>]
});
}
function setNav(sLink)
{
    objInput.value=sLink;
	layer.close(obj);
}
</script>
<link rel="stylesheet" href="css/colpick.css" type="text/css"/>
<div class="d01">
<div class="tabTitle">手机导航设置</div>
<form action="action.aspx?s=addWapNav" class="layui-form" method="post" name="link"><input type="hidden" name="navType" value="0" />
<table width="100%" border="0" class="layui-table" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td width="100">链接名称</td>
<td width="200">链接</td>
<td width="50">图标字</td>
<td width="80">图标颜色</td>
<td width="170">图标</td>
<td width="100">目标窗口</td>
<td width="50">排序</td>
<td width="220">&nbsp;</td>
</tr>
</thead>
<tr>
<td><input type="text" size="12" class="layui-input" name="navName" /></td>
<td><input type="text" size="25" class="layui-input" onFocus="showNav(this)" value="/" id="navUrl" name="navUrl" /></td>
<td><input type="text" size="15" class="layui-input" value="" name="navHead" /></td>
<td><input type="text" size="15" class="layui-input" value="" name="navCss" id="picker" /></td>
<td><input type="hidden" size="15" class="layui-input" value="" name="navPic" id="navPic" /><div class="fl5"><img id="navPicImg" src="images/wap_nav_ico.png" width="35" height="35" /></div><div class="layui-btn layui-btn-primary layui-btn-small" onClick="upNavIco(this,'navPic','navPicImg');">上传</div><div class="layui-btn layui-btn-primary layui-btn-small" onClick="delNavIco('navPic','navPicImg')">删除</div>
</td>
<td>
<select name="navTarget">
<option value="">当前窗口</option>
<option value="_blank">新窗口</option>
</select></td>
<td><input type="text" size="5" class="layui-input" value="100" name="navOrder" /></td>
<td><input type="submit" class="layui-btn" value="添加" /></td></tr>
</table>
</form>
<%=linkTableStr%>
</div>
</div>
</div>
<div class="upfileDiv" style="position:absolute;" id="upfileDiv">
<div class="upfileClose" onClick="$('#upfileDiv').hide();">关闭</div>
<iframe width="400" height="100" style="padding:0px; margin:0px;" src="inc/upFile.aspx?tn=content2&fn=adEdit&js=top.doneNavIco('{picUrl}');" frameborder="0" scrolling="no"></iframe>
</div>
<script>
var inputPic="";
var imgPic="";
function upNavIco(obj,oinp,oimg)
{
	inputPic=oinp;
	imgPic=oimg;
	var xd = getElementPos(obj);
	$("#upfileDiv").css("left",(xd.x-58)+"px");
	$("#upfileDiv").css("top",(xd.y+35)+"px");
	$("#upfileDiv").show();
}
function doneNavIco(picPath)
{
	$('#upfileDiv').hide();
	$("#"+inputPic).val(picPath);
	$("#"+imgPic).attr("src","/"+picPath);
}
function delNavIco(oinp,oimg)
{
	$("#"+oinp).val("");
	$("#"+oimg).attr("src","images/wap_nav_ico.png");
}
$("input[name='navCss']").colpick({
	layout:'hex',
	submit:0,
	colorScheme:'dark',
	onChange:function(hsb,hex,rgb,el,bySetColor) {
		$(el).css('background-color','#'+hex);
		$(el).css('color','#fff');
		// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
		if(!bySetColor) $(el).val(hex);
	}
}).keyup(function(){
	$(this).colpickSetColor(this.value);
});
</script>
</body>
</html>
