<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Vendue.UI_Update" GameType="1" CodePage="65001"  Init_RunningHour="10"  Init_AddSecond="10" Init_AddSecondMax="15" Init_MarketValue="10000" Init_SubPoint="10" Init_AddPrice="1" Init_IsChecked="0"  %>


<script type="text/javascript"> 

function SaveSub(){
		GetOptionText();
		var pass=checkform();
		if(pass){
			var queryString = $('#form_add').serialize();
			$.post("Update.aspx?IsAdd=2", queryString,function(msg){
				if(msg>0){ //先保留msg这个值以备以后使用
					Alert('<%=(VendueInfo.ID>0)?"修改":"添加" %>商品信息成功!',1,function(){Common.Refresh();});
				}
				else if(msg=='-1')
				{
					msg = "<%=(VendueInfo.ID>0)?"修改":"添加" %>竞拍信息失败,拍品号无效.";//代码("+ msg +")";
					AlertErr(msg,2);
				}
				else if(msg=='0')
				{
					msg = "<%=(VendueInfo.ID>0)?"修改":"添加" %>竞拍信息失败.";//代码("+ msg +")";
					AlertErr(msg,2);
				}				
				else
				{
					msg = "<%=(VendueInfo.ID>0)?"修改":"添加" %>竞拍信息失败,本拍品号已添加.";//代码("+ msg +")";
					AlertErr(msg,2);
				}
				
			});
		}
		return false;
	}


function funSucc(id,msg){}
function funFail(id,msg){Common.ShowTipFaceSmile(false,msg,3);}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [   
		{id: "VendueId",type:"mustRegular", par:/[\d]{1,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"竞拍期号不允许为空且必须为数字。");}}
		,{id: "VendueId",type:"mustRegular", par:/[\d]{1,20}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"请选择商品。");}}		
		,{id: "ProductName",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{1,50}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"请选择商品。");}}		
            ]
        //,success: function(){ },failed: function(msg){}
        });
	return ok;	
}


$(document).ready(function(){

/* 模式切换 */
jQuery("#IsHot").change(function(){
	SetPattern(this.value);
});

//初始
SetPattern(<%=VendueInfo.IsHot%>);
});

function SetPattern(n)
{
	var x = parseInt(n,10);
	if(isNaN(x))x=0;
	switch(x)
	{
		case 1:
			jQuery("#Tr_AddSecondItem").show();
			jQuery("#div_PriceAll").hide();
			jQuery("#div_PriceEnd").hide();
			jQuery("#font_PriceStart").html("起始价");
			break;
		case 2:
			
			jQuery("#div_PriceAll").show();
			jQuery("#div_PriceEnd").show();
			jQuery("#font_PriceStart").html("最小值");
			jQuery("#font_PriceEnd").html("最大值");	
			
			jQuery("#Tr_AddSecondItem").hide();
			break;
		case 3:
			
			jQuery("#div_PriceAll").hide();
			jQuery("#div_PriceEnd").hide();
			jQuery("#font_PriceStart").html("起始价");
			jQuery("#Tr_AddSecondItem").hide();			
			break;		
		case 4:
			
			jQuery("#div_PriceAll").show();
			jQuery("#div_PriceEnd").show();
			jQuery("#font_PriceStart").html("最小值");
			jQuery("#font_PriceEnd").html("最大值");	
			
			jQuery("#Tr_AddSecondItem").hide();
			break;
		default:
			jQuery("#Tr_AddSecondItem").hide();
			jQuery("#div_PriceAll").hide();
			jQuery("#div_PriceEnd").hide();
			jQuery("#font_PriceStart").html("起始价");
		break;
		
	}

}
function GetOptionText()
{
return ;
	//$('#BrandName').val($('#BrandId').text())
	var o = $('#ProductId')[0];
	if(o!=null)
	{
		var i = o.selectedIndex;
		$('#ProductName').val(o.options[i].text);
	}
}

function ClearUserIdInfo()
{
	if(confirm("本操作为单向操作，操作后将不能恢复，如果您的系统在运行中，请慎用本功能。\r\n\r\n 【是否确定清除？】"))
	{
		jQuery("#UserId").val("0");jQuery("#UserNickName").val(""); 
	}
}

</script> 



<div style="height:auto;border:0px;width:700px;">
	<form id="form_add">
<div class="TableUpdateDiv"  style="width:97%;">
<div style="width:99%;">
	<table class="TableUpdate" style="text-align:left;">
	
	<tr style="display:none">
	<td >&nbsp;&nbsp; </td>
	</tr>	
	
	<tr>
	<td >
拍品号:
		<input id="GameType" name="GameType" type="hidden" value="<%=VendueInfo.GameType%>" />
		<input id="VendueId" name="VendueId" type="text" class="input" style="width:60px;background-color:<%=(VendueInfo.VendueId>0?"#bbbbbb":"#ffffff")%>"  value="<%=(VendueInfo.VendueId<1?"":VendueInfo.VendueId.ToString())%>" 
		<%=(VendueInfo.VendueId>0?"readonly":"")%>   />
		<input id="ID" name="ID" type="hidden" class="input" style="width:60px;"  value="<%=VendueInfo.ID%>" />
		<span style="color:red">(拍品号须唯一)</span>
	</td>
	</tr>
	
	
	<tr>
	<td  style="text-align:left" >
		商品名称:(只读)
		<input id="ProductName" name="ProductName" type="text" class="input" readonly style="width:200px;"  value="<%=VendueInfo.ProductName%>" />

		<input id="ProductId" name="ProductId" type="text" class="input Hide" readonly style="width:10px;" value="<%=VendueInfo.ProductId%>" />		
		<A onclick="ChooseUser1(<%=VendueInfo.ProductId%>,'ProductName','ProductId',1);">选择</a>
		<select id1="ProductId" name1="ProductId" style="width:260px;"  class="Hide" onclick="GetOptionText()" >
		<%//=GetProductListOption()%>
		</select>				
		<input id="ProductPhotoPath" name="ProductPhotoPath" type="hidden" class="input" style="width:300px;" value="<%=VendueInfo.ProductPhotoPath%>" />
	</td>

	</tr>

	
	<tr>
	<td  style="text-align:left" >
市价:<input id="MarketValue" name="MarketValue" type="text" class="input" style="width:100px;" maxlength="10" value="<%=VendueInfo.MarketValue/ 100f%>" />元
保价:<input id="SafetyValue" name="SafetyValue" type="text" class="input" style="width:100px;"  maxlength="10"  value="<%=VendueInfo.SafetyValue/ 100f%>" />元
运费:<input id="Carriage" name="Carriage" type="text" class="input" style="width:60px;"  maxlength="10"  value="<%=VendueInfo.Carriage/100f%>" />元
		<input id="ProductCount" name="ProductCount" type="hidden" class="input" style="width:100px;"  maxlength="10"  value="<%=VendueInfo.ProductCount%>" />
	</td>
	</tr>
	
	
	<tr>
	<td  style="text-align:left" >
		<div>
		是否保价:
		<SELECT id="IsSafetyValue" name="IsSafetyValue" >
		<option value="0" <%=(VendueInfo.IsSafetyValue==0?"selected":"")%>>禁止</option>
		<option value="1" <%=(VendueInfo.IsSafetyValue==1?"selected":"")%>>允许</option>
		</select>			
		</div>
		
		<div>
		拍品类型:
		<select id="IsTestType" name="IsTestType" style="width:80px;" >
		<option value="0" style="color:red" <%=((VendueInfo.IsTestType==0)?"selected":"")%> >默认</option>
		<option value="1" <%=((VendueInfo.IsTestType==1)?"selected":"")%> >体验区拍品</option>
		</select>	
		</div>
		<div>
		状态:
		<select id="IsChecked" name="IsChecked" style="width:50px;" >
		<option value="0" style="color:red" <%=((VendueInfo.IsChecked==0)?"selected":"")%> >停用</option>
		<option value="1" <%=((VendueInfo.IsChecked==1)?"selected":"")%> >启用</option>
		</select>	
		</div>
		<div>
		推荐:
		<select id="OrderId" name="OrderId" style="width:60px;" class="OptionStar">
		<option value="0" <%=((VendueInfo.OrderId==0)?"selected":"")%>>默认</option>
		<option value="1" class="Star1" <%=((VendueInfo.OrderId==1)?"selected":"")%> >1星</option>
		<option value="2" class="Star1" <%=((VendueInfo.OrderId==2)?"selected":"")%> >2星</option>
		<option value="3" class="Star1" <%=((VendueInfo.OrderId==3)?"selected":"")%> >3星</option>
		<option value="4" class="Star2" <%=((VendueInfo.OrderId==4)?"selected":"")%> >4星</option>
		<option value="5" class="Star2" <%=((VendueInfo.OrderId==5)?"selected":"")%> >5星</option>
		<option value="6" class="Star2" <%=((VendueInfo.OrderId==6)?"selected":"")%> >6星</option>
		<option value="7" class="Star3" <%=((VendueInfo.OrderId==7)?"selected":"")%> >7星</option>
		<option value="8" class="Star3" <%=((VendueInfo.OrderId==8)?"selected":"")%> >8星</option>
		<option value="9" class="Star3" <%=((VendueInfo.OrderId==9)?"selected":"")%> >9星</option>
		<option value="10" class="Star3" <%=((VendueInfo.OrderId==10)?"selected":"")%> >10星</option>		
		</select>
		</div>
		<div style="display:none;">
		规则模式:
		<select id="IsHot" name="IsHot" style="width:60px;" >
		<option value="1" <%=((VendueInfo.IsHot==1)?"selected":"")%> >模式一(默认)</option>
		<option value="2" <%=((VendueInfo.IsHot==2)?"selected":"")%> >模式二</option>
		<option value="3" <%=((VendueInfo.IsHot==3)?"selected":"")%> >模式三</option>
		<option value="4" <%=((VendueInfo.IsHot==4)?"selected":"")%> >模式四</option>
		</select>
		</div>
	</td>
	</tr>
	
	
	
	<tr>
	<td  style="text-align:left" >

		进入倒计时时间:
		<input id="InitStartTime" name="InitStartTime" type="text" class="input" style="width:140px;"  value="<%= string.Format("{0:yyyy-MM-dd HH:mm:ss}",VendueInfo.InitStartTime) %>" />	&nbsp;	&nbsp;(进入倒计时时间)

		
	</td>
	</tr>
	
	<tr>
	<td >		
		默认倒计时为0的时间：
		<input id="InitStopTime" name="InitStopTime" type="text" class="input" style="width:140px;"  value="<%= string.Format("{0:yyyy-MM-dd HH:mm:ss}",VendueInfo.InitStopTime) %>" />
		&nbsp;&nbsp;
	
		实际成拍时间:
		<input id="RealStopTime" name="RealStopTime" type="text" class="input" style="width:140px;background-color:#DDDDDD;" value="<%= string.Format("{0:yyyy-MM-dd HH:mm:ss}",VendueInfo.RealStopTime) %>" readonly1 />
	
	</td>
	</tr>
	
		
	<tr>
	<td >
		<div style="display:none;">	
		增价/减价:
		<select id="GameRuleType" name="GameRuleType" style="width:100px;" >
		<option value="0" style="color:red" <%=((VendueInfo.GameRuleType==0)?"selected":"")%> >↑增价秒杀</option>
		<option value="-1" <%=((VendueInfo.GameRuleType==-1)?"selected":"")%> >↓减价秒杀</option>
		</select>
		</div>
		<div>
		价位<%=VendueInfo.GameRuleType>-1?"升高":"<font color='red'>降低</font>"%>:￥<input id="AddPrice" name="AddPrice" type="text" class="input" style="width:70px;"  maxlength="4"   value="<%=VendueInfo.AddPrice/100f %>" />
		</div>

	</td>
	</tr>
	
	<tr>
	<td >
		
		<div id="div_PriceStart" >
		<font id="div_PriceAll" style="display:none;font-weight:bold;">出价范围:</font>
		<font id="font_PriceStart">起始价</font>:￥<input id="InitPrice" name="InitPrice" type="text" class="input" style="width:70px;"  maxlength="8"   value="<%=VendueInfo.InitPrice/ 100f %>" />元
		</div>
		
		<div  id="div_PriceEnd"  style="display:none;">
		<font id="font_PriceEnd">停止价</font>:￥<input id="EndPrice" name="EndPrice" type="text" class="input" style="width:70px;"  maxlength="8"   value="<%=VendueInfo.EndPrice/100f %>" />元
		</div>
		<div>
		
		扣点数:<input id="SubPoint" name="SubPoint" type="text" class="input" style="width:70px;"  maxlength="3"   value="<%=VendueInfo.SubPoint %>" />点/次
		</div>
		
	</td>
	</tr>		

	<tr id="Tr_AddSecondItem" >

	<td style="text-align:left;margin-bottom:8px" >
		增加时间:<input id="AddSecond" name="AddSecond" type="text" class="input" style="width:70px;"  maxlength="3"   value="<%=VendueInfo.AddSecond%>" />秒/次 
		<span style="display:inline-block;padding:0px 3px 0px 3px;background-color:#Dddddd;">
		(&nbsp;是否启用时间封顶:		
		<select id="IsAddSecondMax" name="IsAddSecondMax" style="width:100px;" >
		<option value="1" style="color:red" <%=((VendueInfo.IsAddSecondMax==1)?"selected":"")%> >启用</option>
		<option value="0" <%=((VendueInfo.IsAddSecondMax==0)?"selected":"")%> >不启用</option>
		</select>&nbsp;&nbsp;
		封顶时间:<input id="AddSecondMax" name="AddSecondMax" type="text" class="input" style="width:70px;"  maxlength="8"   value="<%=VendueInfo.AddSecondMax %>" />秒	&nbsp;)&nbsp;&nbsp;&nbsp;
		</span>
	</td>
	</tr>		
		
		
	</td>
	</tr>		
	
	
	
	<tr style="display:none;">
	<td style="text-align:left;margin-bottom:0px;"  >	
		<font color="red">入场费</font>:
		<input id="Entrancefees" name="Entrancefees" type="text" class="input" style="width:70px;"  value="<%=VendueInfo.Entrancefees %>" />点
		&nbsp;&nbsp;
		
	</tr>
	</tr>
	<tr>
	<td style="text-align:left;margin-bottom:5px;background-color:#Dddddd;"  >
		<div>
		出价次数:<span class="Font_Red"><%=VendueInfo.VendueCount %></span>次
		<input id="VendueCount" name="VendueCount" type="hidden" class="input" style="width:100px;"  value="<%=VendueInfo.VendueCount %>" />
		</div>
		<div>
		当前预拍出价:(人民币)
		<input id="RealPrice" name="RealPrice" type="text" class="input" style="width:100px;background-color:#Dddddd;color:red;display:auto;"  value="<%=VendueInfo.RealPrice/100f  %>" Readonly />元
		</div>


		<div>
		
		成交状态:	
		
		<select id="VendueState" name="VendueState" style="width:70px;background-color:#Dddddd;"  >
		<option value="<%=(VendueInfo.VendueState<3?VendueInfo.VendueState:0) %>" <%=(VendueInfo.VendueState<3?"selected":"") %>>未成交</option>
		<option value="<%=(VendueInfo.VendueState>=3?VendueInfo.VendueState:3) %>" <%=(VendueInfo.VendueState>=3?"selected":"") %>>已成交</option>
		</select>		
		
		&nbsp;		

		</div>
	</td>
	</tr>		
	
	<tr>
	<td style="text-align:left;margin-bottom:5px;background-color:#Dddddd;"  >
	
		<div>
		<%=VendueInfo.VendueState>=3?"实际成交":"最后出价人出价"%>时间:
		<input id="RealStopTime" name="RealStopTime" type="text" class="input" style="width:140px;background-color:#DDDDDD;" value="<%= string.Format("{0:yyyy-MM-dd HH:mm:ss}",VendueInfo.RealStopTime) %>" readonly />&nbsp;
		</div>
	
	
		<div style="">
		当前预竞拍人(只读):<font class="Font_Black" style="display:none;"><%=VendueInfo.UserNickName %></font>
		ID<input id="UserId" name="UserId" type="text" class="input" style="width:40px;background-color:#DDD;"  value="<%=VendueInfo.UserId%>" Readonly />
		昵称<input id="UserNickName" name="UserNickName" type="text" class="input" style="width:80px;background-color:#DDD;"  value="<%=VendueInfo.UserNickName%>" Readonly />
		</div>
		<div style="display:none;">
		<a href="#" onclick='ClearUserIdInfo();'  style="background-color:#ddd;border:1px solid #888;padding:2px;" title="商家作弊手段，如无必要须将其去掉。">清除竞拍人</a>
		</div>
	</td>
	</tr>	
	
	
	<tr style="display:none;">
	<td >
		产品简介:(如需修改,请在产品管理模块中修改)
		<textarea id="ProductBrief" name="ProductBrief" class="input" style="width:450px;height:50px;display:none" ><%=VendueInfo.ProductBrief %></textarea>
		<div class="Font_Black" style="overflow-y:scroll;width:460px;height:200px;border:1px solid #CCCCCC;background-color:#f6f6f6">
		<%=VendueInfo.ProductBrief%>
		</div>
	</td>
	</tr>
	
	

	
	</table>
	

	</div>
</div>	


</form>
	
</div>
<script>
	//LoadEditor("ProductBrief");
	
</script>
