<{import file="index/header_shop.html" title="基础信息"}> 
<style type="text/css">
.base_lft{ width:700px; float:left; } 
.base_rit{ width:220px; float:left; }

.sp_logo{ width:120px; background:#f8f8f8; border:1px solid #eee; margin:10px 0 0 0; float:left;}
.sp_logo span{width:120px; height:120px; line-height:120px; text-align:center; float: left;} 
.sp_logo span img{ max-height:120px; max-width:120px; }
.uploadfile{ width:100%; padding:3px 0; height:20px; line-height:20px; position:relative; cursor:pointer; color:#666; background:#efefef; text-align:center; overflow: hidden; display: inline-block; *display: inline; *zoom: 1; float:left; } 
.uploadfile input{position:absolute; font-size:100px; right:0; top:0; opacity:0; filter:alpha(opacity=0); cursor:pointer; } 
.uploadfile:hover {color: #444; background:#eee; border-color:#ccc; text-decoration:none; }
</style> 
<div class="tab_name"><span>店铺信息</span></div>
<div class="baseBox">
	<div class="base_lft">
	<form action="?m=shop&a=base_save" method="post" id="form" back="false"> 
		<table class="etable">
			<tr>
				<td width="100">店铺名称： </td>
				<td><input type="text" name="name" size="38" id="text" value="<{$row.name}>"/></td>
			</tr>
			<tr>
				<td>主营业务： </td>
				<td><input type="text" name="main_seller" size="38" id="text" value="<{$row.main_seller}>"/></td>
			</tr>
			<tr>
				<td>店铺介绍： </td>
				<td><textarea name="intro" cols="40" rows="3"><{$row.intro}></textarea></td>
			</tr>
			<tr>
				<td>联系人： </td>
				<td><input type="text" name="contact" size="38" id="contact" value="<{$row.contact}>"/></td>
			</tr> 
			<tr>
				<td>电话： </td>
				<td><input type="text" name="mobile" size="38" id="mobile" value="<{$row.mobile}>"/></td>
			</tr>
			<tr>
				<td>邮箱： </td>
				<td><input type="text" name="email" size="38" value="<{$row.email}>"/></td>
			</tr>
			<tr>
				<td>QQ号： </td>
				<td><input type="text" name="qq" size="38" value="<{$row.qq}>"/></td>
			</tr>
			<tr>
				<td>旺旺号： </td>
				<td><input type="text" name="ww" size="38" value="<{$row.ww}>"/></td>
			</tr> 
			<tr>
				<td>地址： </td>
				<td><div class="area_box"></div></td>
			</tr>
			<tr>
				<td>详细地址： </td>
				<td><input type="text" name="address" size="38" id="text" value="<{$row.address}>"/></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" name="submit" class="submit" value="保 存"/></td>
			</tr>  
		</table>
	</form> 
	</div>
	<div class="base_rit">
		<div class="sp_logo">
			<span>
				<{if $row.logo == ''}>
					<img src="<{$__PUBLIC__}>images/shop.png" id="back_img_url"/>
				<{else}>
					<img src="<{$__IMG__}><{$row.logo|img_size:120x120}>" id="back_img_url"/>
				<{/if}>				
			</span>
			<div class="uploadimg">
				<a href="javascript:;" id="update_avatar" class="uploadfile">
					上传店标<input type="file" name="imgFile" id="imgFile"/>
				</a>
			</div>
		</div> 
		
	</div>
</div>
<{include file="index/footer.html"}>
<script type="text/javascript" src="<{$__PUBLIC__}>js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<{$__PUBLIC__}>js/area.js"></script>
<script type="text/javascript">
$(function(){
	<{if $row.prov == '' && $row.city == '' && $row.dist == ''}>
		$(".area_box").area();
	<{else}>	
		$(".area_box").area({
			'prov':'<{$row.prov}>',
			'city':'<{$row.city}>',
			'dist':'<{$row.dist}>'
		});	
	<{/if}> 
	$(document).on("change", "#update_avatar", function(){ 
		$("#upload_msg").ajaxStart(function(){ 
      		$(this).show(); 
   		}); 
		$.ajaxFileUpload({ 
		   	url:'?m=album&a=sp_logo', 
		   	secureuri:false,
		   	fileElementId:'imgFile', 
		   	dataType: 'text', 
		   	success: function(result){ 
				data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					$(".sp_logo img").attr('src',data.url); 
				}else{ 
					alert(data.msg); 
				}
			}
		});
	});
	
}); 
</script>