Browse Source

广告主创意中心 素材替换更新

Signed-off-by: jiapeng.dong <jiapeng.dong@cloudcross.com>
jiapeng.dong 9 years ago
parent
commit
e5ee45c694

+ 25 - 7
src/main/webapp/WEB-INF/pages/advertiser/main/ad/banner-template/index.ftl

@@ -9,13 +9,31 @@
 	<!--Include Required Prerequisites js-->
 	<!--Include Required Prerequisites js-->
 	<script type="text/javascript" src="${ctx}/assets/advertiser/js/jquery-1.9.1.min.js"></script>
 	<script type="text/javascript" src="${ctx}/assets/advertiser/js/jquery-1.9.1.min.js"></script>
 <style>
 <style>
-table td a{background-color: #36aeea;
-    border: medium none;
-    border-radius: 5px;
-    color: #ffffff;
-    font-size: 12px;
-    height: 34px;
-    width: 90px;}
+.replace-file {
+display:block;
+overflow:hidden;
+position:relative;
+ background-color: #36aeea;
+ border: medium none;
+ border-radius: 5px;
+ color: #ffffff;
+ font-size: 12px;
+ height: 34px;
+ width: 90px;
+ float:left;
+ text-align:center;
+ line-height:34px;
+}
+.replace-file input{
+opacity:0;
+filter:alpha(opacity=0);
+font-size:100px;
+position:absolute;
+top:0;
+right:0;
+width:90px
+}
+
 </style>
 </style>
 
 
 </@override>
 </@override>

+ 5 - 7
src/main/webapp/WEB-INF/pages/advertiser/main/ad/banner-template/list.ftl

@@ -32,11 +32,9 @@
             	<#if bannerTemplate.type == 1>Flash<#elseif bannerTemplate.type == 2>图片<#else>视频</#if>
             	<#if bannerTemplate.type == 1>Flash<#elseif bannerTemplate.type == 2>图片<#else>视频</#if>
             </td>
             </td>
             <td style="width:15%" class="hidden-480">${bannerTemplate.updated?datetime}</td>
             <td style="width:15%" class="hidden-480">${bannerTemplate.updated?datetime}</td>
-            <td style="width:9%"><#if bannerTemplate.status==0>开启<#else>停用</#if></td>
-            <td style="width:30%">
-            	<a href="javascript:;" id="uploadFile_banner" style="margin:0 5px 0 5px;">替换素材
-					<input type="file" id="file${bannerTemplate.id}" valueId="${bannerTemplate.id!}"/>
-				</a>
+            <td style="width:5%"><#if bannerTemplate.status==0>开启<#else>停用</#if></td>
+            <td style="width:40%">
+            	<span class="replace-file">替换素材<input type="file" id="file${bannerTemplate.id}" valueId="${bannerTemplate.id!}"></span>     
                 <button href="${ctx}/advertiser/main/ad/banner-template/alterName?id=${bannerTemplate.id!}" style="margin:0 5px 0 5px;">修改名称</button>
                 <button href="${ctx}/advertiser/main/ad/banner-template/alterName?id=${bannerTemplate.id!}" style="margin:0 5px 0 5px;">修改名称</button>
                 <#if bannerTemplate.status==0>
                 <#if bannerTemplate.status==0>
                 <button class="btn-status" data-toggle="dropdown" href="${ctx}/advertiser/main/ad/banner-template/disable?id=${bannerTemplate.id!}" style="margin-right:5px;">暂停</button>
                 <button class="btn-status" data-toggle="dropdown" href="${ctx}/advertiser/main/ad/banner-template/disable?id=${bannerTemplate.id!}" style="margin-right:5px;">暂停</button>
@@ -66,14 +64,14 @@
 
 
 <script type="text/javascript">
 <script type="text/javascript">
 $(function () {
 $(function () {
-	$('#uploadFile_banner input').each(function(){
+	$('.replace-file input').each(function(){
 		var bannerTemplateId = $(this).attr("valueId");
 		var bannerTemplateId = $(this).attr("valueId");
 		$(this).fileupload({
 		$(this).fileupload({
 		autoUpload: true,
 		autoUpload: true,
 		url: '${ctx}/advertiser/main/ad/banner-template/replace',
 		url: '${ctx}/advertiser/main/ad/banner-template/replace',
 		formData:{bannerTemplateId:bannerTemplateId},
 		formData:{bannerTemplateId:bannerTemplateId},
 		done:function(e,result){
 		done:function(e,result){
-			alert(1);
+			alert(result.result);
 			$('#pagecontent .search-form').find('img').click();
 			$('#pagecontent .search-form').find('img').click();
 	        console.log(JSON.stringify(result.result));            
 	        console.log(JSON.stringify(result.result));            
 	          }
 	          }