有弹出页面的新增

来源:互联网 发布:社会图软件 编辑:程序博客网 时间:2024/05/21 17:54

调用页面“

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../../common/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${pageContext.servletContext.contextPath }/css/cms/admin.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="${pageContext.servletContext.contextPath }/js/jquery-1.8.3.min.js"></script>
<title>鲜易精选图片位</title>
<style type="text/css">
.xec_floor1_left {
width: 950px;
padding-top: 30px;
}
.xec_floor1_left a {
display: inline-block;
position: relative;
}

.xec_floor1_left a i{
display: block;
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
font-style: normal;
color: #000000;
font-weight: bold;
background-color: #fff;
border:1px solid #EEEEEE;
position: absolute;
top: 0;
right: 0;
z-index: 999;
}

.xec_floor1_left a:hover i{
display: block;
}
.floor1_con img{
_zoom: 1;
}
.floor1_con a {
width: 230px;
height: 200px;
background-color: #fff;
display: inline-block;
float: left;
overflow: hidden
}
.grid_245 {
width: 245px
}
.grid_460 {
width: 460px
}
.xec_floor1_left{}
.grid_290{width: 290px;}
.grid_660{width: 600px;}
.grid_660 a{width: 200px;height: 150px;}
.new_rank i.editPic,.new_record i.editPic{ width: auto;padding: 0 10px;height: 30px;line-height: 30px;}
.p-command{line-height:1.5;padding:10px 0;font-size:18px;font-weight:bold}
</style>
<script type="text/javascript">
var obj ,loc;
$(document).ready(function(){
$("body").on("click", ".editPic", function() {
var img=$(this).parent().find("img");
obj=$(this);
loc = parseInt(obj.siblings("input[name$=locationStr]").val());
$("#location").val(loc);
   $("#outputWidth").val(img.attr("w"));
   $("#outputHeight").val(img.attr("h"));
$("#zoom").val(false);
$("#url").val($(this).parent().find("input[name$=url]").val());
$("#path").val($(this).parent().find("input[name$=picurl]").val());
$("#parfloor").val($("#form").find("input[name$=parfloor]").val());
if(loc > 1 && loc<13 ){
$("#product").val($(this).parent().find("input[name$=title]").val());
$("#price").val($(this).parent().find("input[name$=remark1]").val());
$("#unit").val($(this).parent().find("input[name$=remark2]").val());
}
if(loc > 12 ){
$("#vendorname").val($(this).parent().find("input[name$=title]").val());
}
generateMask(loc); 
myMask();
});
$(".setImg").find("input[name$=picurl]").each(function(){
if(!$(this).val()){
$(this).parent().find("img").attr("src","");
}
//${pageContext.servletContext.contextPath }/images/yellow.jpg
});  

$(".submitButton").on("click", function() {
  var notSum = 0;
$("#form").find("input[name$=picurl]").each(function(i){
if($(this).val() != ""){
notSum = notSum+1;
}
});
var parfloor = parseInt($("input[name=parfloor]").val() || "0");
if(parfloor % 2 != 0 && notSum < 19){
alert("请保证19个位置信息填写完整!");
return false;
}
else if(parfloor % 2 == 0 && notSum < 7) {
alert("请保证7个位置信息填写完整!");
return false;

if($("#recommendStr").attr("checked")) {
$("#recommend").val('1');
}else {
$("#recommend").val('0');
}
$("#form").ajaxSubmit({
type: "POST", 
dataType: "json", 
success: function(json) {
if(json !=null && json!=""){
//var json = JSON.parse(json); 
alert(json.msg);//保存结果提示
checkSubmitFlg = false;
if(json.msg == "保存成功"){
window.location.href="${pageContext.servletContext.contextPath }/cms/home/queryHomeDatas.html";
}
}
},
error: function(err) {
alert("保存失败!");
checkSubmitFlg = false;
}
}); 
return false;
});


});

function generateMask(loc) {
//上传表单内容的显示和隐藏(逻辑可能需要你再看看,大体可以这么做);
var form = $("#maskForm");
if(loc == 1 ) {
form.find(".tr_productname_label").css("display", "none");
form.find(".tr_vendorprice").css("display", "none");
form.find(".tr_measureunit").css("display", "none");
form.find(".tr_shop_link").css("display", "");
form.find(".tr_vendorname_label").css("display", "none");
form.find(".tr_logo_file").css("display", "none");
}else if(loc > 1 && loc <13 ){
form.find(".tr_shop_link").css("display", "none");
form.find(".tr_vendorprice").css("display", "");
form.find(".tr_measureunit").css("display", "");
form.find(".tr_productname_label").css("display", "");
form.find(".tr_vendorname_label").css("display", "none");
form.find(".tr_logo_file").css("display", "none");
}else{
form.find(".td_file_lable").text("选择logo:");
form.find(".tr_good_link").css("display", "none");
form.find(".tr_logo_file").css("display", "none");
form.find(".tr_shop_link").css("display", "");
form.find(".tr_vendorname_label").css("display", "");
form.find(".tr_productname_label").css("display", "none");
form.find(".tr_vendorprice").css("display", "none");
form.find(".tr_measureunit").css("display", "none");
}
form.find(".tr_desr_label").css("display", "none");
form.find(".tr_backcolor").css("display", "none");
form.find(".tr_backcolor_link").css("display", "none");
form.find(".tr_productremark_label").css("display", "none");
}
 
//为图片位赋值
  function setValues(){
  obj.parent().find("input[name$=url]").val($("#url").val());
obj.parent().find("input[name$=picurl]").val($("#path").val());
obj.parent().find("img").attr("src","${PicServer}"+$("#path").val());
if(loc > 1){
obj.parent().find("input[name$=title]").val($("#product").val());
if(loc <13){
obj.parent().find("input[name$=remark2]").val($("#unit").val());
obj.parent().find("input[name$=remark1]").val($("#price").val());
}
}
obj=null;
loc=null;

</script>
</head>


<body>
<form action="${pageContext.servletContext.contextPath }/cms/home/save.html" method="post" id="form" >
<input type="hidden" name="pageNow" value="${pageNow }"/>
<input type="hidden" name="parfloor" value="${homeColumn.parfloor }"/>
<input type="hidden" name="menuId" value="${homeColumn.menuId }"/>
<input type="hidden" name="recommend" id="recommend" value="${homeColumn.recommend }"/>
<input type="hidden" name="title" id="title" value="${homeColumn.title }"/>
<input type="hidden" name="picnums" id="picnums" value="${homeColumn.picnums }"/>
<div class="form_horizontal">
<table class="" width="100%">
<tr>
<td align="right">模块名称:</td>
<td>
${homeColumn.title }
</td>
</tr>
</table>
<div class="form_horizontalBox">
<div class="setImg clearfix">
<div class="setImg_hint cr_999">
注意:<!-- <span style="color:#b70000">楼层只能推荐商品,请确定推荐商品信息!</span> -->
如果尺寸修改过大,可能导致前台页面显示不正常
</div>
<!--begin-->
<div class="xec_floor1_left  clearfix">
<div class="grid_290 fl">
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index1.picurl}" width="290" height="300" alt="图片1" w="300"   h="330" alt="图片1"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[0].id" value="${index1.id }"/>
<input type="hidden" name="childrenList[0].url" value="${index1.url }"/>
<input type="hidden" name="childrenList[0].picurl" value="${index1.picurl }"/>
<input type="hidden" name="childrenList[0].locationStr" value="1"/>
<input type="hidden" name="childrenList[0].uuid" value="${index1.uuid }"/>
</a>
</div>
<div class="grid_660  floor1_con fl">
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index2.picurl}" width="200" height="150" w="220"   h="165" alt="图片2"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[1].id" value="${index2.id }"/>
<input type="hidden" name="childrenList[1].url" value="${index2.url }"/>
<input type="hidden" name="childrenList[1].picurl" value="${index2.picurl }"/>
<input type="hidden" name="childrenList[1].title" value="${index2.title }"/>
<input type="hidden" name="childrenList[1].locationStr" value="2"/>
<input type="hidden" name="childrenList[1].uuid" value="${index2.uuid }"/>
<input type="hidden" name="childrenList[1].remark1" value="${index2.remark1 }"/>
<input type="hidden" name="childrenList[1].remark2" value="${index2.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index3.picurl}" width="200" height="150" w="220"   h="165" alt="图片3"/>
<c:if test="${flag != 0}">
<i class="editPic" style="color:#000;">编辑</i>
</c:if>
<input type="hidden" name="childrenList[2].id" value="${index3.id }"/>
<input type="hidden" name="childrenList[2].url" value="${index3.url }"/>
<input type="hidden" name="childrenList[2].picurl" value="${index3.picurl }"/>
<input type="hidden" name="childrenList[2].title" value="${index3.title }"/>
<input type="hidden" name="childrenList[2].locationStr" value="3"/>
<input type="hidden" name="childrenList[2].uuid" value="${index3.uuid }"/>
<input type="hidden" name="childrenList[2].remark1" value="${index3.remark1 }"/>
<input type="hidden" name="childrenList[2].remark2" value="${index3.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index4.picurl}" width="200" height="150" w="220"   h="165" alt="图片4"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[3].id" value="${index4.id }"/>
<input type="hidden" name="childrenList[3].url" value="${index4.url }"/>
<input type="hidden" name="childrenList[3].picurl" value="${index4.picurl }"/>
<input type="hidden" name="childrenList[3].title" value="${index4.title }"/>
<input type="hidden" name="childrenList[3].locationStr" value="4"/>
<input type="hidden" name="childrenList[3].uuid" value="${index4.uuid }"/>
<input type="hidden" name="childrenList[3].remark1" value="${index4.remark1 }"/>
<input type="hidden" name="childrenList[3].remark2" value="${index4.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index5.picurl}" width="200" height="150" w="220"   h="165" alt="图片5"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[4].id" value="${index5.id }"/>
<input type="hidden" name="childrenList[4].url" value="${index5.url }"/>
<input type="hidden" name="childrenList[4].picurl" value="${index5.picurl }"/>
<input type="hidden" name="childrenList[4].title" value="${index5.title }"/>
<input type="hidden" name="childrenList[4].locationStr" value="5"/>
<input type="hidden" name="childrenList[4].uuid" value="${index5.uuid }"/>
<input type="hidden" name="childrenList[4].remark1" value="${index5.remark1 }"/>
<input type="hidden" name="childrenList[4].remark2" value="${index5.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index6.picurl}" width="200" height="150" w="220"   h="165" alt="图片6"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[5].id" value="${index6.id }"/>
<input type="hidden" name="childrenList[5].url" value="${index6.url }"/>
<input type="hidden" name="childrenList[5].picurl" value="${index6.picurl }"/>
<input type="hidden" name="childrenList[5].title" value="${index6.title }"/>
<input type="hidden" name="childrenList[5].locationStr" value="6"/>
<input type="hidden" name="childrenList[5].uuid" value="${index6.uuid }"/>
<input type="hidden" name="childrenList[5].remark1" value="${index6.remark1 }"/>
<input type="hidden" name="childrenList[5].remark2" value="${index6.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index7.picurl}" width="200" height="150" w="220"   h="165" alt="图片7"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[6].id" value="${index7.id }"/>
<input type="hidden" name="childrenList[6].url" value="${index7.url }"/>
<input type="hidden" name="childrenList[6].picurl" value="${index7.picurl }"/>
<input type="hidden" name="childrenList[6].title" value="${index7.title }"/>
<input type="hidden" name="childrenList[6].locationStr" value="7"/>
<input type="hidden" name="childrenList[6].uuid" value="${index7.uuid }"/>
<input type="hidden" name="childrenList[6].remark1" value="${index7.remark1 }"/>
<input type="hidden" name="childrenList[6].remark2" value="${index7.remark2 }"/>
</a>
</div>
</div>
<c:if test="${homeColumn.parfloor %2 != 0 }">
<div class="clearfix xec_floor1_left">
<!-- 人气排行 -->
<p class="p-command">人气排行</p>
<div class="new_rank">
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index8.picurl}" width="160" height="120" w="50"   h="50" alt="图片8"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[7].id" value="${index8.id }"/>
<input type="hidden" name="childrenList[7].url" value="${index8.url }"/>
<input type="hidden" name="childrenList[7].picurl" value="${index8.picurl }"/>
<input type="hidden" name="childrenList[7].title" value="${index8.title }"/>
<input type="hidden" name="childrenList[7].locationStr" value="8"/>
<input type="hidden" name="childrenList[7].uuid" value="${index8.uuid }"/>
<input type="hidden" name="childrenList[7].remark1" value="${index8.remark1 }"/>
<input type="hidden" name="childrenList[7].remark2" value="${index8.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index9.picurl}" width="160" height="120" w="50"   h="50" alt="图片9"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[8].id" value="${index9.id }"/>
<input type="hidden" name="childrenList[8].url" value="${index9.url }"/>
<input type="hidden" name="childrenList[8].picurl" value="${index9.picurl }"/>
<input type="hidden" name="childrenList[8].title" value="${index9.title }"/>
<input type="hidden" name="childrenList[8].locationStr" value="9"/>
<input type="hidden" name="childrenList[8].uuid" value="${index9.uuid }"/>
<input type="hidden" name="childrenList[8].remark1" value="${index9.remark1 }"/>
<input type="hidden" name="childrenList[8].remark2" value="${index9.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index10.picurl}" width="160" height="120" w="50"   h="50" alt="图片10"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[9].id" value="${index10.id }"/>
<input type="hidden" name="childrenList[9].url" value="${index10.url }"/>
<input type="hidden" name="childrenList[9].picurl" value="${index10.picurl }"/>
<input type="hidden" name="childrenList[9].title" value="${index10.title }"/>
<input type="hidden" name="childrenList[9].locationStr" value="10"/>
<input type="hidden" name="childrenList[9].uuid" value="${index10.uuid }"/>
<input type="hidden" name="childrenList[9].remark1" value="${index10.remark1 }"/>
<input type="hidden" name="childrenList[9].remark2" value="${index10.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index11.picurl}" width="160" height="120" w="50"   h="50" alt="图片11"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[10].id" value="${index11.id }"/>
<input type="hidden" name="childrenList[10].url" value="${index11.url }"/>
<input type="hidden" name="childrenList[10].picurl" value="${index11.picurl }"/>
<input type="hidden" name="childrenList[10].title" value="${index11.title }"/>
<input type="hidden" name="childrenList[10].locationStr" value="11"/>
<input type="hidden" name="childrenList[10].uuid" value="${index11.uuid }"/>
<input type="hidden" name="childrenList[10].remark1" value="${index11.remark1 }"/>
<input type="hidden" name="childrenList[10].remark2" value="${index11.remark2 }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index12.picurl}" width="160" height="120" w="50"   h="50" alt="图片12"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[11].id" value="${index12.id }"/>
<input type="hidden" name="childrenList[11].url" value="${index12.url }"/>
<input type="hidden" name="childrenList[11].picurl" value="${index12.picurl }"/>
<input type="hidden" name="childrenList[11].title" value="${index12.title }"/>
<input type="hidden" name="childrenList[11].locationStr" value="12"/>
<input type="hidden" name="childrenList[11].uuid" value="${index12.uuid }"/>
<input type="hidden" name="childrenList[11].remark1" value="${index12.remark1 }"/>
<input type="hidden" name="childrenList[11].remark2" value="${index12.remark2 }"/>
</a>
</div>
<!-- 商户推荐 -->
<p class="p-command">商户推荐</p>
<div class="new_record">
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index13.picurl}"  width="120" height="80" w="100"   h="50" alt="图片13"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[12].id" value="${index13.id }"/>
<input type="hidden" name="childrenList[12].url" value="${index13.url }"/>
<input type="hidden" name="childrenList[12].picurl" value="${index13.picurl }"/>
<input type="hidden" name="childrenList[12].title" value="${index13.title }"/>
<input type="hidden" name="childrenList[12].locationStr" value="13"/>
<input type="hidden" name="childrenList[12].uuid" value="${index13.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index14.picurl}"  width="120" height="80" w="100"   h="50" alt="图片14"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[13].id" value="${index14.id }"/>
<input type="hidden" name="childrenList[13].url" value="${index14.url }"/>
<input type="hidden" name="childrenList[13].picurl" value="${index14.picurl }"/>
<input type="hidden" name="childrenList[13].title" value="${index14.title }"/>
<input type="hidden" name="childrenList[13].locationStr" value="14"/>
<input type="hidden" name="childrenList[13].uuid" value="${index14.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index15.picurl}"  width="120" height="80" w="100"   h="50" alt="图片15"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[14].id" value="${index15.id }"/>
<input type="hidden" name="childrenList[14].url" value="${index15.url }"/>
<input type="hidden" name="childrenList[14].picurl" value="${index15.picurl }"/>
<input type="hidden" name="childrenList[14].title" value="${index15.title }"/>
<input type="hidden" name="childrenList[14].locationStr" value="15"/>
<input type="hidden" name="childrenList[14].uuid" value="${index15.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index16.picurl}"  width="120" height="80" w="100"   h="50" alt="图片16"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[15].id" value="${index16.id }"/>
<input type="hidden" name="childrenList[15].url" value="${index16.url }"/>
<input type="hidden" name="childrenList[15].picurl" value="${index16.picurl }"/>
<input type="hidden" name="childrenList[15].title" value="${index16.title }"/>
<input type="hidden" name="childrenList[15].locationStr" value="16"/>
<input type="hidden" name="childrenList[15].uuid" value="${index16.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index17.picurl}"  width="120" height="80" w="100"   h="50" alt="图片17"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[16].id" value="${index17.id }"/>
<input type="hidden" name="childrenList[16].url" value="${index17.url }"/>
<input type="hidden" name="childrenList[16].picurl" value="${index17.picurl }"/>
<input type="hidden" name="childrenList[16].title" value="${index17.title }"/>
<input type="hidden" name="childrenList[16].locationStr" value="17"/>
<input type="hidden" name="childrenList[16].uuid" value="${index17.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index18.picurl}"  width="120" height="80" w="100"   h="50" alt="图片18"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[17].id" value="${index18.id }"/>
<input type="hidden" name="childrenList[17].url" value="${index18.url }"/>
<input type="hidden" name="childrenList[17].picurl" value="${index18.picurl }"/>
<input type="hidden" name="childrenList[17].title" value="${index18.title }"/>
<input type="hidden" name="childrenList[17].locationStr" value="18"/>
<input type="hidden" name="childrenList[17].uuid" value="${index18.uuid }"/>
</a>
<a href="javascript:;">
<img class="lazy" src="${PicServer}${index19.picurl}"  width="120" height="80" w="100"   h="50" alt="图片19"/>
<c:if test="${flag != 0}">
<i class="editPic">编辑</i>
</c:if>
<input type="hidden" name="childrenList[18].id" value="${index19.id }"/>
<input type="hidden" name="childrenList[18].url" value="${index19.url }"/>
<input type="hidden" name="childrenList[18].picurl" value="${index19.picurl }"/>
<input type="hidden" name="childrenList[18].title" value="${index19.title }"/>
<input type="hidden" name="childrenList[18].locationStr" value="19"/>
<input type="hidden" name="childrenList[18].uuid" value="${index19.uuid }"/>
</a>
</div>
</div>
</c:if>
<!--end-->
</div>
<table width="100%">
<tr>
<td width="60" valign="top" align="right">“更多”链接:</td>
<td><textarea type="text" class="addtextarea" style="overflow-y:hidden" rows="5" cols="60" name="description">${homeColumn.description }</textarea>
</td>
</tr>
<tr>
<td width="60" valign="top" align="right">是否启用:</td>
<td>
<input type="checkbox" name="recommendStr" id="recommendStr" disabled
<c:if test="${homeColumn.recommend eq 1}">checked="checked"</c:if>/>
<label for="recommendStr">启用</label>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<c:if test="${flag != 0}">
<input type="submit" name="button" id="button" value="保存" class="adminsubmit submitButton" />
</c:if>
<input type="button" name="button" id="button" value="返回" onclick="javascript:history.back();" class="adminsubmit" />
</td>
</tr>
</table>
</div>
</div>
</form>
<%@include file="./uploadPic.jsp"%>
</body>


</html>


被调用页面:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<style type="text/css">
#mask_bg {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
z-index: 1001;
}


#mask {
display: none;
position: fixed;
top: 60%;
left: 50%;
width: 400px;
padding: 15px 20px;
line-height: 30px;
margin-left: -160px;
border: 2px solid #FFF;
background-color: #FFF;
z-index: 1002;
overflow: auto;
font-family:"微软雅黑";
border-radius: 5px;
}
#mask div {
padding-bottom:20px;
}


.popMask_black_con{
  display: none;
  width: 100%;
  height: 100%;
  background: #000;
  background: rgba(0,0,0,.5);
  filter: alpha(opacity=50);
  position: fixed;
  _position: absolute;
  z-index: 999;
  left: 0;
  top: 0;
}
._mask_upload{
margin-left:55px;
}
.mot_btn_box {
padding: 0px 10px;
height: 30px;
line-height: 30px;
border: 1px solid #d6d6d6;
border-radius: 5px;
background: #fff;
vertical-align: middle;
display: inline-block;
margin-right: 10px;
font-size: 12px;
cursor: pointer;
_height: 25px;
_line-height: 25px;
_padding-top: 6px;
}
.Td_one{width: 87px;display: inline-block;}
</style>


<!--enctype="multipart/form-data" -->
<div id="mask_bg"></div>
<div id="mask"><!-- 弹出的上传文件对话框 -->
<!-- <form action="http://192.168.26.91:4080/xe-image/imageUploadCtrl/handleUpload" id="maskForm" -->
<form action="${pageContext.servletContext.contextPath }/cms/homepage/uploadVendor.html" id="maskForm"
 method="POST" enctype="multipart/form-data" target="hidden_frame">
<!--  <div><span style="color:#b70000">楼层只能推荐商品,请确定推荐商品信息!</span></div> -->
<table>
<tr class="tr_backcolor_link">
<td class="Td_one"><span style="color:#b70000">背景色示例:</span></td>
<td><span style="color:#b70000">b6dcff</span></td>
</tr>
<tr class="tr_backcolor">
<td>背景色:</td>
<!-- <td><input type="text" style="width:10px;color:gray" value="#" disabled="disabled"/><input type="text" id="bgcolor" maxlength="6"/></td> -->
<td><input type="text" name="backcolor" id="backcolor"/></td> 
</tr>
<tr class="tr_file_lable">
<td class="td_file_lable">选择图片:</td>
<td><input type="file" name="file" id="file"/></td>
</tr>
<tr class="tr_logo_file">
<td>选择logo:</td>
<td><input type="file" name="logoFile" id="logoFile"/></td>
</tr>
<tr class="tr_shop_link">
<td class="Td_one"><span style="color:#b70000">店铺链接示例:</span></td>
<td><span style="color:#b70000">http://www.xebest.com/2846.shtml</span></td>
</tr>
<tr class="tr_good_link">
<td class="Td_one"><span style="color:#b70000">商品链接示例:</span></td>
<td><span style="color:#b70000">http://qa-item.xebest.com//150722173252279.shtml</span></td>
</tr>
<tr>
<td>链接地址:</td>
<td><input type="text" name="url" id="url"/></td>
</tr>
<tr class="tr_vendorname_label">
<td>商户名称:</td>
<td><input type="text" name="vendorname" id="vendorname"/></td>
</tr>
<tr class="tr_desr_label">
<td>商户主营:</td>
<td><input type="text" name="desr" id="desr"/></td>
</tr>
<tr class="tr_productname_label">
<td>商品名称:</td>
<td><input type="text" name="product" id="product"/></td>
</tr>
<tr class="tr_productremark_label">
<td>商品标注:</td>
<td><input type="text" name="productremark" id="productremark"/></td>
</tr>
<tr class="tr_vendorprice">
<td>商品价格:</td>
<td><input type="text" name="price" id="price"/></td>
</tr>
<tr class="tr_measureunit">
<td>计量单位:</td>
<td><input type="text" name="unit" id="unit"/></td>
</tr>


</table>
<input type="hidden" name="outputWidth" id="outputWidth"/>
<input type="hidden" name="outputHeight" id="outputHeight"/>
<input type="hidden" name="fileType" value="2" id="fileType"/>
<input type="hidden" name="path" id="path"/>
<input type="hidden" name="zoom" id="zoom"/>
<input type="hidden" name="logoPath" id="logoPath"/>
<input type="hidden" name="logoZoom" id="logoZoom"/>
<input type="hidden" name="parfloor" id="parfloor"/>
<input type="hidden" name="location" id="location"/>


<a href="javascript:;"  class="mot_btn_box _mask_upload">保存</a>
<a href="javascript:;"  class="mot_btn_box" onclick="hidMask();">取消</a>
</form>
<iframe style="display: none" name='hidden_frame' id="hidden_frame"></iframe>
</div>
<!-- 此处是搞什么用:遮罩层 -->
<div class="popMask_black_con"></div>
<script type="text/javascript" src="${pageContext.servletContext.contextPath }/js/jquery.form.js"></script>
<script type="text/javascript">
//后来写这块的人,每块属性不一样的都分开吧,然后写到common里,总之以后鲜易网也没了,要不你就重做吧,此页面只适合未改版之前的首页
$(function() {
//------  绑定 提交form事件 
$("._mask_upload").on("click", function() {
    if(!$("#file").val()){
    if(!$("#path").val()){
    if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>12 ){
alert("请选择logo!");
}else{
alert("请选择图片!");
}
return;
    }
}
if($("#parfloor").val() == 206 && !$("#backcolor").val()){
alert("请填写背景色值!");
return;
}
if($("#parfloor").val()>210 &&$("#parfloor").val()<214 && !$("#logoFile").val() ){
if(!$("#logoPath").val()){
alert("请选择logo!");
return;
}
}
if(!$("#url").val()){
alert("请填写链接!");
return;
}
  if($("#parfloor").val()!=206 && $("#parfloor").val()!=216 &&$("#location").val() != 1){
var reg = /^http(.*)?\d+(.*)?\.shtml$/;   //包含数字的
if(!reg.test($("#url").val())) {
alert("请填写正确的的链接");
return;
}

if($("#parfloor").val()>210 && $("#parfloor").val()<214 && !$("#vendorname").val()){
alert("请输入商户名称!");
return;
}
  if(($("#parfloor").val()==207 || $("#parfloor").val()==208) && $("#location").val()==6 && !$("#productremark").val()){
alert("请输入商品标注!");
return;

if($("#parfloor").val()>210 && $("#parfloor").val()<214 && !$("#desr").val()){
alert("请输入商户主营!");
return;
}
if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>12 && !$("#vendorname").val() ){
alert("请输入商户名称!");
return;
}
if($("#parfloor").val()>206 && $("#parfloor").val()<211 && $("#location").val()>1 && !$("#product").val()){
alert("请输入商品名称!");
return;
}
  if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>1 && $("#location").val()<13 && !$("#product").val()){
alert("请输入商品名称!");
return;
}
if($("#parfloor").val()>206 && $("#parfloor").val()<211 && $("#location").val()>1 && !$("#price").val() ){
alert("请输入商品价格!");
return;
}
if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>1 && $("#location").val()<13 && !$("#price").val()){
alert("请输入商品价格!");
return;
}
if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>1 && $("#location").val()<13  && !$("#unit").val()){
alert("请输入计量单位!");
return;

if($("#parfloor").val()>216 && $("#parfloor").val()<229 && $("#location").val()>1 && $("#location").val()<13 && !$("#unit").val()){
alert("请输入计量单位!");
return;

if($("#parfloor").val()>210 &&$("#parfloor").val()<214&&!$("#file").val() && !$("#logoFile").val()){
setValues();
$("input[type=file]").val("");
hidMask();
}else if(($("#parfloor").val()<211||$("#parfloor").val()>213)&&!$("#file").val()){
setValues();
$("input[type=file]").val("");
hidMask();
}else{
$("#maskForm").ajaxSubmit({
type: "POST",
success: function(data) {
if(data!=""){
var json = JSON.parse(data); 
if($("#file").val()){
$("#path").val(json.picurl);
}
if($("#logoFile").val()){
$("#logoPath").val(json.logo);
}
setValues();
$("input[type=file]").val("");
$("input[type=logoFile]").val("");
}
hidMask();
},
error: function(err) {
alert("提交失败!");
}
});
}
});
});

/**
* 弹出对话框方法
* @param hid
* @param ad
*/
function myMask() {

var top = ($(window).height() - $("#mask").height()) / 2;
var scrollTop = $(document).scrollTop();
$("#mask").css({"top": "50%",'margin-top':-$("#mask").height() / 2});
$("#mask").fadeIn(200);
$(".popMask_black_con").show();
}
/**
* 隐藏弹出框  方法
*/
function hidMask(){
$(".popMask_black_con").hide();
$("#maskForm")[0].reset();//重置form
$("#mask").fadeOut(200);
}
</script>

0 0
原创粉丝点击