<?php /* Smarty version Smarty-3.1.8, created on 2015-11-25 16:37:30
         compiled from "D:\wwwroot\o2o\htdocs\themes\default\xiche\ucenter\addr\add.html" */ ?>
<?php /*%%SmartyHeaderCode:784356502917458150-87383683%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'aa895b1a3dc906d590263636a01f56779be9340b' => 
    array (
      0 => 'D:\\wwwroot\\o2o\\htdocs\\themes\\default\\xiche\\ucenter\\addr\\add.html',
      1 => 1448439353,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '784356502917458150-87383683',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_565029174e0cf8_19020677',
  'variables' => 
  array (
    'addr' => 0,
    'MEMBER' => 0,
    'lat' => 0,
    'lng' => 0,
    'gid' => 0,
    'car_id' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_565029174e0cf8_19020677')) {function content_565029174e0cf8_19020677($_smarty_tpl) {?><?php if (!is_callable('smarty_function_link')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\function.link.php';
?><!DOCTYPE HTML>
<html>
    <head>
        <?php echo $_smarty_tpl->getSubTemplate ("xiche/block/sheader.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

       
    </head>
    <body>
<header>
	<i class="left"><a id="icon_goback"  href="#"></a></i>
    <div class="title">添加常用地址</div>
    <i class="right"></i>
</header>
<section id="index" class="page_center_box">
	<div class="youhui_no">
		<div class="iconBg">
			<i class="ico1"></i>
		</div>
 	</div>
	<ul class="form_list_box" id="carInfor">
	    <li class="pd0 mb10">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
                
                <tr>
                    <th><em class="ico_5"></em></th>
                    <td><input type="text" name="addr" id="addr" placeholder="选择地址" value="<?php echo $_smarty_tpl->tpl_vars['addr']->value;?>
"></td>
                </tr>
                
                <tr>
                    <th><em class="ico_4"></em></th>
                    <td><input type="text" name="contact" id="contact" placeholder="您的名字"></td>
                </tr>
                <tr>
                    <th><em class="ico_4"></em></th>
                    <td><input type="text" name="mobile" value="<?php echo $_smarty_tpl->tpl_vars['MEMBER']->value['mobile'];?>
" id="mobile" placeholder="您的手机"></td>
                </tr>
                <tr>
                    <th><em class="ico_6"></em></th>
                    <td>
                        <input type="text" name="remark" id="remark" placeholder="添加备注，方便找到车辆">
                        <input type="hidden" name="lat" id="lat" value="<?php echo $_smarty_tpl->tpl_vars['lat']->value;?>
">
                        <input type="hidden" name="lng" id="lng" value="<?php echo $_smarty_tpl->tpl_vars['lng']->value;?>
">
                        <input type="hidden" name="gid" id="gid" value="<?php echo $_smarty_tpl->tpl_vars['gid']->value;?>
">
                        <input type="hidden" name="car_id" id="car_id" value="<?php echo $_smarty_tpl->tpl_vars['car_id']->value;?>
">
                    </td>
                </tr>
            </table>
        </li>
    </ul>
    <div class="yuee_btn"> <a href="javascript:void(0);" class="btn" id="add_addr">保存</a></div>
</section>

<script type="text/javascript">
    
    require(["zepto", "underscore", "frozen"], function($, _, fz) {
        
        $('#add_addr').click(function(){

            var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/addr/add_handle'),$_smarty_tpl);?>
";
            var contact = $('#contact').val();
            var mobile = $('#mobile').val();
            var addr = $('#addr').val();
            var remark = $('#remark').val();
            var gid = $('#gid').val();
            var car_id = $('#car_id').val();
 
            $.post(link,{contact:contact,mobile:mobile,addr:addr,remark:remark,gid:gid}, function (ret) {
 
                if(ret.error == 101){
                    warning('您还没有登录？登录后即可操作！',"<?php echo smarty_function_link(array('ctl'=>'xiche/passport:login'),$_smarty_tpl);?>
");
                }else if (ret.error) {
                    $.tips({content: ret.message, stayTime: 2000});
                } else {
                    $.tips({content: ret.message, stayTime: 2000});
                    setTimeout(function () {
                        if(gid){
                           if(car_id){
                               window.location.href = '<?php echo smarty_function_link(array('ctl'=>"xiche/ucenter/addr",'gid'=>$_smarty_tpl->tpl_vars['gid']->value,'car_id'=>$_smarty_tpl->tpl_vars['car_id']->value),$_smarty_tpl);?>
';
                           }else{
                               window.location.href = '<?php echo smarty_function_link(array('ctl'=>"xiche/ucenter/addr",'gid'=>$_smarty_tpl->tpl_vars['gid']->value),$_smarty_tpl);?>
';
                           }
                        }else{
                           window.location.href = '<?php echo smarty_function_link(array('ctl'=>"xiche/ucenter/addr"),$_smarty_tpl);?>
';
                        }
                    }, 1000)
                }
            }, 'json');
            
        })
        
        $('#addr').click(function(){
            var gid = '<?php echo $_smarty_tpl->tpl_vars['gid']->value;?>
';
            var car_id = '<?php echo $_smarty_tpl->tpl_vars['car_id']->value;?>
';
            if(gid){
                if(car_id){
                    window.location.href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/addr/location','gid'=>$_smarty_tpl->tpl_vars['gid']->value,'car_id'=>$_smarty_tpl->tpl_vars['car_id']->value),$_smarty_tpl);?>
";
                }else{
                    window.location.href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/addr/location','gid'=>$_smarty_tpl->tpl_vars['gid']->value),$_smarty_tpl);?>
"; 
                } 
            }else{
                window.location.href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/addr/location'),$_smarty_tpl);?>
";
            }
        })
        $('#list3').addClass('on');

        
    });

</script>
<footer>

        <?php echo $_smarty_tpl->getSubTemplate ("xiche/block/sfooter.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

    </body>
</html><?php }} ?>