<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>

<!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="X-UA-Compatible" content="IE=EmulateIE7" />
		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />

		<title></title>
		<link href="../../style/blue/css/main.css" type="text/css" rel="stylesheet" />
		<link href="../../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../../common/js/jquery-1.7.gzjs"></script>
		<script language="javascript" type="text/javascript" src="../../javascript/commonUtil_src.js"></script>
		<script>
			
			 
			
			
		</script>
	</head>
	<body>
	
	<form   method="post">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" valign="top">
					<!--main start-->
				

					
						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
							
							<tr>
								<td width="29%" class="input-title">
									<strong>封面图片</strong>
								</td>
								<td class="td-input">
								
									<select id="imageType" class="form-select">
									
										<%--<option value="text">---- 不需要封面图 ----</option>
										
										
										
										--%><option value="content" selected>使用内容缩略图&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
										<option value="class">使用栏目缩略图</option>
										<option value="channel">使用频道缩略图</option>
										<option value="home">使用首页缩略图</option>
									
									</select>
								
									 
								</td>
							</tr>
							
							<tr>
								<td width="28%" class="input-title">
									<strong>推送模式</strong>
								</td>
								<td class="td-input">
								
									<input type="radio" name="preview" value="true" checked/>预览内容
									
									<input type="radio" name="preview" value="false"/>所有用户组
								
									 
								</td>
							</tr>
						

						</table>
						<!-- hidden -->
						<input type="hidden" id="entry" name="entry" value="${param.entry}" />
							
							 
					</form>
					<div style="height:15px"></div>
					<div class="breadnavTab"  >
						<table width="100%" border="0" cellspacing="0" cellpadding="0" >
							<tr class="btnbg100">
								<td width="53%" class="input-title">

								</td>
								<td class="td-input">								
									<a href="javascript:sendWx();"  class="btnwithico"><img src="../../style/icons/tick.png" width="16" height="16" id="submitTagClassFormImg"/><b>确定&nbsp;</b> </a>
									<a href="javascript:close();"  class="btnwithico" onclick=""><img src="../../style/icon/close.png" width="16" height="16"/><b>取消&nbsp;</b> </a>
								</td>
								 
							</tr>
						</table>
					</div>
				</td>
			</tr>
	
	
	
	</body>
</html>

<script type="text/javascript">

var api = frameElement.api, W = api.opener; 

 


function sendWx()
{
  
 		 disableAnchorElementByName("btnwithicosysflag",true);
	 
	 	var url = "<cms:BasePath/>content/sendWXContent.cmd?contentId="+W.$('#contentId').val()+"&modelId="+W.$('#modelId').val()+"&imageType="+$('#imageType').val()+"&preview="+$("input[name='preview'][checked]").val();
	    var postData = '';
	 
		$.ajax({
		      	type: "GET",
		       	url: url,
		       	async:false,
		       	data:postData,
		   
		       	success: function(msg)
		        {        
		       
		        	if('error:no_image' == msg)
		        	{
		        			W.$.dialog({ 
					   					title :'提示',
					    				width: '160px', 
					    				height: '70px', 
					                    lock: true, 
					                    parent: api,
					    				icon: '32X32/fail.png', 
					    				
					                    content: '所选缩略图不存在或丢失!',
					                    
					                    
					                             
					                   cancel: true
		
						
					   		});
					   		
					   		disableAnchorElementByName("btnwithicosysflag",false);
					   		
					   		return;
					  }
					  
					 if('error:censor_err' == msg)
		        	{
		        			W.$.dialog({ 
					   					title :'提示',
					    				width: '160px', 
					    				height: '70px', 
					                    lock: true, 
					                    parent: api,
					    				icon: '32X32/fail.png', 
					    				
					                    content: '内容没有通过审核！!',
					                    
					                    
					                             
					                   cancel: true
		
						
					   		});
					   		
					   		disableAnchorElementByName("btnwithicosysflag",false);
					   		
					   		return;
					  }
					  
					  if('error:sys_err' == msg)
		        	{
		        			W.$.dialog({ 
					   					title :'提示',
					    				width: '160px', 
					    				height: '70px', 
					                    lock: true, 
					                    parent: api,
					    				icon: '32X32/fail.png', 
					    				
					                    content: '系统发生异常！请联系维护人员!',
					                    
					                    
					                             
					                   cancel: true
		
						
					   		});
					   		
					   		disableAnchorElementByName("btnwithicosysflag",false);
					   		
					   		return;
					  }
					  
					 
					  
					  var jsonObj = eval("("+msg+")");
		              
		              
		              
		              if(jsonObj.errcode == 0)
		              {	
		              	disableAnchorElementByName("btnwithicosysflag",false);
		              	              	
		              	W.$.dialog.tips('推送到微信成功',2,'32X32/succ.png'); 
		              }
		              else
		              {
		              	W.$.dialog({ 
					   					title :'提示',
					    				width: '260px', 
					    				height: '70px', 
					                    lock: true, 
					                    parent: api,
					    				icon: '32X32/fail.png', 
					    				
					                    content: '推送到微信失败!<br/>返回状态码：'+jsonObj.errcode+'<br/>错误信息：'+jsonObj.errmsg,
					                    
					                    
					                             
					                   cancel: true
		
						
					   	});
					   	 
					   	 disableAnchorElementByName("btnwithicosysflag",false);
					   	 
					   	 return;
		              }
		              
		              
					 
					   
					   api.close();  
		        }
		 });	
 			
	      
}


function close()
{
	     
    api.close();      
}
				
									
</script>

