<!--{include file="<!--{$oetplpath}-->public/cart_top.tpl"}--> 
<script src="<!--{$skinpath}-->public/js/order.js"></script> 
<!--确认订单开始-->
<div class="oe_cart_second">
  <div class="oe_cart_second_title"> 确认收货地址 <a href="<!--{$urlpath}-->index.php?m=user&c=address">管理收货地址</a> </div>
  <div class="oe_cart_address">
    <div class="oe_cart_addresscn"> 
      <!--{if !empty($address)}--><!--{/if}--> 
      <!--{foreach $address as $val}--> 
      <dl <!--{if $val.isdefault==1}-->class="current"<!--{/if}--> f="data-address" gid="<!--{$val.addrid}-->">
      <dt f="data-consignee-<!--{$val.addrid}-->"><!--{$val.contname}--> 收 (<!--{$val.contphone}-->)</dt>
      <dd> <font  f="data-address-<!--{$val.addrid}-->"><!--{area type='text' value=$val.area1}--> <!--{area type='text' value=$val.area2}--> <!--{area type='text' value=$val.area3}--> <!--{area type='text' value=$val.area4}--> <!--{$val.street}--></font> <span class="oe_crt_edit <!--{if $val.isdefault==1}-->current<!--{/if}-->" f="oe_crt_edit" id="<!--{$val.addrid}-->">修改</span> <span class="oe_crt_default <!--{if $val.isdefault==1}-->current<!--{/if}-->" f="oe_crt_default">默认地址</span> <span class="oe_crt_gou <!--{if $val.isdefault==1}-->current<!--{/if}-->" f="oe_crt_gou"></span> </dd>
      </dl>
      <!--{/foreach}-->
      
      <div class="clear"></div>
      <div class="oe_cart_newaddress"> <a href="javascript:;" f="data-add-address">使用新地址</a> <span></span> </div>
    </div>
  </div>
  <form action="<!--{$urlpath}-->index.php?c=order" method="post" name="myform" id="myform" f="myform" >
    <div class="oe_cart_second_list">
      <h2><span>确认订单信息</span> <a href="<!--{$urlpath}-->index.php?c=cart">返回购物车修改</a> </h2>
      <div class="oe_cart_top_title"> <span class="oe_cart_span_1">店铺商品</span> <span class="oe_cart_span_2">单价(元)</span> <span class="oe_cart_span_3">数量</span> <span class="oe_cart_span_4">小计(元)</span>
        <div class="clear"></div>
      </div>
      <!--{foreach $goodlist.cart as $val}-->
      <div class="oe_cart_second_listcn">
        <div class="oe_cart_list_title">商家：<a href="<!--{$urlpath}-->index.php?c=shop&a=detail&id=<!--{$val.shopid}-->"><!--{$val.shopname}--></a> </div>
        <dl>
          <!--{foreach $val.goodslist as $v}-->
          <dd class="oe_dd_1"> <span class="oe_cart_list_2"> <a href="<!--{$urlpath}-->index.php?c=goods&a=detail&id=<!--{$v.goodsid}-->"><img src="<!--{$v.thumbimg}-->" class="pic"/></a> <a href="<!--{$urlpath}-->index.php?c=goods&a=detail&id=<!--{$v.goodsid}-->"><!--{$v.goodsname}--> </a>
            <p><img src="<!--{$skinpath}-->public/images/cart_b.png" alt="" /></p>
            </span> <span class="oe_cart_list_3"> <!--{$v.pricelist.name}--> </span> <span class="oe_cart_list_4"> <b><!--{$v.price}--></b> </span> <span class="oe_cart_list_5"> <!--{$v.nums}--></span> <span class="oe_cart_list_6"> <b><!--{$v.total}--></b> </span> <span class="oe_cart_list_7"> </span>
            <div class="clear"></div>
          </dd>
          <!--{/foreach}-->
          <dd class="oe_dd_2">
            <div class="oe_dd_2_guest"> <span>给卖家留言：</span>
              <textarea name="postscript_<!--{$val.shopid}-->" id="postscript_<!--{$val.shopid}-->" placeholder="选填：对本次交易的说明（建议填写已经和卖家达成一致的说明）" ></textarea>
            </div>
            <div class="oe_dd_2_post"> <span>运送方式：快递</span>
              <label>运费：<b><!--{$val.shipfee}-->元</b></label>
            </div>
            <div class="clear"></div>
          </dd>
          <dd class="oe_dd_3"> <span>店铺合计(含运费，服务费)：</span><i>¥</i><b><!--{$val.shoptotal}--> </b> </dd>
        </dl>
      </div>
      <!--{/foreach}--> 
      
    </div>
    <div class="oe_cart_second_bottom">
      <div style="display: none;">
        <p>
		  <b>支付方式：</b>
          <label>
            <input type="radio" name="paytype" id="paytype" value="1" checked >
            在线支付
		  </label>
        </p>
      </div>
      <div class="oe_cart_second_bottom_address">
        <dl>
          <dt><span>实付款：</span> <i>¥</i> <b><!--{$goodlist.amount}--></b> </dt>
          <dd>
            <p><b>寄送至：</b><font f="dis-address"> <!--{area type='text' value=$default_add.area1}-->省 <!--{area type='text' value=$default_add.area2}-->市 <!--{area type='text' value=$default_add.area3}--> <!--{area type='text' value=$default_add.area4}--> <!--{$default_add.street}--> </font></p>
            <p><b>收货人：</b><font f="dis-con"> <!--{$default_add.contname}--> <!--{$default_add.contphone}--></font></p>
          </dd>
        </dl>
      </div>
      <div class="oe_cart_second_button" style="margin-top:10px;">
	    <a href="<!--{$urlpath}-->index.php?c=cart">返回购物车</a>
        <input type="hidden" value="<!--{$goodlist.goods}-->" name="goodslist" id="goodslist" f="goodslist">
        <input type="hidden" value="<!--{$default_add.isdefault}-->"  name="address" id="address" f="address">
        <span f="confirm_order">提交订单</span>
	  </div>
    </div>
    <!--确认订单结束-->
  </form>
</div>
<script>
$(function(){
    //订单提交
    $("[f='confirm_order']").click(function(){
        $goodslist = $("[f='goodslist']").val();
        $addrid = $("[f='address']").val();

		if ($goodslist.length == 0) {
			ToastShow("没有可购买的商品");
			return false;
		}
		if ($addrid.length == 0) {
			ToastShow("请选择收货地址");
			return false;
		}
        if($('input[name="paytype"]:checked').val()=='0'){
            <!--{if empty($login.user.payword)}-->
            if(confirm("请先设置支付密码！")){
                window.location.href="<!--{$oefile}-->?m=user&c=profile&a=setpaypass";
            }else{
                return false;
            }
            <!--{else}-->
            $(".confirmorder_box").css("display","block");
            <!--{/if}-->
        }
		else{
            $("#myform").submit();
        }
    });
});

</script> 
<!--{include file="<!--{$oetplpath}-->public/widget_footer.tpl"}-->
</body>
</html>