{js:artTemplate}
<script type='text/javascript' src='{webroot:public/javascript/orderFormClass.js}'></script>
<script type='text/javascript'>
//创建订单表单实例
orderFormInstance = new orderFormClass();

//DOM加载完毕
jQuery(function(){
	//商家信息
	orderFormInstance.seller = {echo:JSON::encode($this->seller)};

	//商品价格
	orderFormInstance.goodsSum = "{$this->final_sum}";

	//配送方式初始化
	orderFormInstance.deliveryInit("{$this->custom['delivery']}");

	//收货地址数据
	orderFormInstance.addressInit();

	//支付方式
	orderFormInstance.paymentInit("{$this->custom['payment']}");

	//免运费
	orderFormInstance.freeFreight = {echo:JSON::encode($this->freeFreight)};
});
</script>

<div class="wrapper clearfix">
	<div class="position mt_10"><span>您当前的位置：</span> <a href="{url:}"> 首页</a> » 填写核对订单信息</div>
	<div class="myshopping m_10">
		<ul class="order_step">
			<li class="current_prev"><span class="first"><a href='{if:IReq::get('id')}javascript:window.history.go(-1);{else:}{url:/simple/cart}{/if}'>1、查看购物车</a></span></li>
			<li class="current"><span>2、填写核对订单信息</span></li>
			<li class="last"><span>3、成功提交订单</span></li>
		</ul>
	</div>

	<form action='{url:/simple/cart3}' method='post' name='order_form' onsubmit='return orderFormInstance.isSubmit()'>

		<input type='hidden' name='direct_gid' value='{$this->gid}' />
		<input type='hidden' name='direct_type' value='{$this->type}' />
		<input type='hidden' name='direct_num' value='{$this->num}' />
		<input type='hidden' name='direct_promo' value='{$this->promo}' />
		<input type='hidden' name='direct_active_id' value='{$this->active_id}' />

		<div class="cart_box m_10">
			<div class="title">填写核对订单信息</div>
			<div class="cont">

				<!--地址管理 开始-->
				<div class="wrap_box">
					<h3>
						<span class="orange">收货人信息</span>
					</h3>

					<div class="prompt_4 m_10">
						<strong>常用收货地址</strong>
						<ul class="addr_list">
							{foreach:items=$this->addressList}
							<li id="addressItem{$item['id']}">
								<label><input class="radio" name="radio_address" type="radio" value="{$item['id']}" onclick="orderFormInstance.getDelivery({$item['province']});" />{$item['accept_name']}&nbsp;&nbsp;&nbsp;{$item['province_val']} {$item['city_val']} {$item['area_val']} {$item['address']}</label> [<a href="javascript:orderFormInstance.addressEdit({$item['id']});" style="color:#005ea7;">修改地址</a>] [<a href="javascript:orderFormInstance.addressDel({$item['id']});" style="color:#005ea7">删除</a>]
							</li>
							{/foreach}
							<li>
								<label><a href="javascript:orderFormInstance.addressAdd();" style="color:#005ea7;">添加新地址</a></label>
							</li>
						</ul>

						<!--收货地址项模板-->
						<script type='text/html' id='addressLiTemplate'>
						<li id="addressItem<%=item['id']%>">
							<label><input class="radio" name="radio_address" type="radio" value="<%=item['id']%>" onclick="orderFormInstance.getDelivery(<%=item['province']%>);" /><%=item['accept_name']%>&nbsp;&nbsp;&nbsp;<%=item['province_val']%> <%=item['city_val']%> <%=item['area_val']%> <%=item['address']%></label> [<a href="javascript:orderFormInstance.addressEdit(<%=item['id']%>);" style="color:#005ea7;">修改地址</a>] [<a href="javascript:orderFormInstance.addressDel(<%=item['id']%>);" style="color:#005ea7">删除</a>]
						</li>
						</script>
					</div>
				</div>
				<!--地址管理 结束-->

				<!--配送方式 开始-->
				<div class="wrap_box">
					<h3>
						<span class="orange">配送方式</span>
					</h3>

					<table width="100%" class="border_table m_10">
						<colgroup>
							<col width="180px" />
							<col />
						</colgroup>

						<tbody>
							{foreach:items = Api::run('getDeliveryList')}
							<tr>
								<th><label><input type="radio" name="delivery_id" value="{$item['id']}" paytype="{$item['type']}" onclick='orderFormInstance.deliverySelected({$item['id']});' />{$item['name']}</label></th>
								<td>
									<span id="deliveryShow{$item['id']}"></span>
									{$item['description']}
									{if:$item['type'] == 2}
									<a href="javascript:orderFormInstance.selectTakeself({$item['id']});"><span class="red">选择自提点</span></a>
									<span id="takeself{$item['id']}"></span>
									{/if}
								</td>
							</tr>
							{/foreach}
						</tbody>

						<!--配送信息-->
						<script type='text/html' id='deliveryTemplate'>
							<span style="color:#e4393c">运费：￥<%=item['price']%></span>
							<%if(item['protect_price'] > 0){%>
							<span style="color:#e4393c">保价：￥<%=item['protect_price']%></span>
							<%}%>
						</script>

						<!--物流自提点-->
						<script type='text/html' id='takeselfTemplate'>
							[<%=item['address']%> <%=item['name']%> <%=item['phone']%> <%=item['mobile']%>]
						</script>

						<tfoot>
							<th>指定送货时间：</th>
							<td>
								<label class='attr'><input type='radio' name='accept_time' checked="checked" value='任意' />任意</label>
								<label class='attr'><input type='radio' name='accept_time' value='周一到周五' />周一到周五</label>
								<label class='attr'><input type='radio' name='accept_time' value='周末' />周末</label>
							</td>
						</tfoot>
					</table>
				</div>
				<!--配送方式 结束-->

				<!--支付方式 开始-->
				<div class="wrap_box" id="paymentBox">
					<h3>
						<span class="orange">支付方式</span>
					</h3>

					<table width="100%" class="border_table">
						<colgroup>
							<col width="200px" />
							<col />
						</colgroup>
						{foreach:items = Api::run('getPaymentList')}
						{set:$paymentPrice = CountSum::getGoodsPaymentPrice($item['id'],$this->sum);}
						<tr>
							<th><label><input class="radio" name="payment" alt="{$paymentPrice}" onclick='orderFormInstance.paymentSelected({$item['id']});' title="{$item['name']}" type="radio" value="{$item['id']}" />{$item['name']}</label></th>
							<td>{$item['note']} {if:$paymentPrice}支付手续费：￥{$paymentPrice}{/if}</td>
						</tr>
						{/foreach}
					</table>
				</div>
				<!--支付方式 结束-->

				<!--订单留言 开始-->
				<div class="wrap_box">
					<h3>
						<span class="orange">订单附言</span>
					</h3>

					<table width="100%" class="form_table">
						<colgroup>
							<col width="120px" />
							<col />
						</colgroup>
						<tr>
							<th>订单附言：</th>
							<td><input class="normal" type="text" name='message' /></td>
						</tr>
					</table>
				</div>
				<!--订单留言 结束-->

				<!--购买清单 开始-->
				<div class="wrap_box">

					<h3><span class="orange">购买的商品</span></h3>

					<div class="cart_prompt f14 t_l m_10" {if:empty($this->promotion)}style="display:none"{/if}>
						<p class="m_10 gray"><b class="orange">恭喜，</b>您的订单已经满足了以下优惠活动！</p>
						{foreach:items = $this->promotion}
						<p class="indent blue">{$item['plan']}，{$item['info']}</p>
						{/foreach}
					</div>

					<table width="100%" class="cart_table t_c">
						<colgroup>
							<col width="115px" />
							<col />
							<col width="80px" />
							<col width="80px" />
							<col width="80px" />
							<col width="80px" />
							<col width="80px" />
						</colgroup>

						<thead>
							<tr>
								<th>图片</th>
								<th>商品名称</th>
								<th>赠送积分</th>
								<th>单价</th>
								<th>优惠</th>
								<th>数量</th>
								<th class="last">小计</th>
							</tr>
						</thead>

						<tbody>
							<!-- 商品展示 开始-->
							{foreach:items = $this->goodsList}
							<tr>
								<td><img src="{url:/pic/thumb/img/$item[img]/w/66/h/66}" width="66px" height="66px" alt="{$item['name']}" title="{$item['name']}" /></td>
								<td class="t_l">
									<a href="{url:/site/products/id/$item['goods_id']}" class="blue">{$item['name']}</a>
									{if:isset($item['spec_array'])}
									<p>
									{set:$spec_array=Block::show_spec($item['spec_array']);}
									{foreach:items=$spec_array item=$specValue key=$specName}
										{$specName}：{$specValue} &nbsp&nbsp
									{/foreach}
									</p>
									{/if}
								</td>
								<td>{$item['point']}</td>
								<td><b>￥{$item['sell_price']}</b></td>
								<td>减￥{$item['reduce']}</td>
								<td>{$item['count']}</td>
								<td id="deliveryFeeBox_{$item['goods_id']}_{$item['product_id']}_{$item['count']}"><b class="red2">￥{$item['sum']}</b></td>
							</tr>
							{/foreach}
							<!-- 商品展示 结束-->
						</tbody>
					</table>
				</div>
				<!--购买清单 结束-->

			</div>
		</div>

		<!--金额结算-->
		<div class="cart_box">
			<div class="cont_2">
				<strong>结算信息</strong>
				<div class="pink_box">
					<p class="f14 t_l">{if:$this->final_sum != $this->sum}优惠后总金额{else:}商品总金额{/if}：<b>{$this->final_sum}</b> - 代金券：<b name='ticket_value'>0</b> + 税金：<b id='tax_fee'>0</b> + 运费总计：<b id='delivery_fee_show'>0</b> + 保价：<b id='protect_price_value'>0</b> + 支付手续费：<b id='payment_value'>0</b></p>

					<a class="fold" href='javascript:orderFormInstance.ticketShow();'>
						<b class="orange">使用代金券</b>
					</a>
				</div>

				<hr class="dashed" />
				<div class="pink_box gray m_10">
					<table width="100%" class="form_table t_l">
						<colgroup>
							<col width="220px" />
							<col />
							<col width="250px" />
						</colgroup>

						<tr>
							<td>是否需要发票？(税金:￥{$this->goodsTax}) <input class="radio" onclick="orderFormInstance.doAccount();$('#tax_title').toggle();" name="taxes" type="checkbox" value="{$this->goodsTax}" /></td>
							<td><label id="tax_title" class='attr' style='display:none'>发票抬头：<input type='text' class='normal' name='tax_title' /></label></td>
							<td class="t_r"><b class="price f14">应付总额：<span class="red2">￥<b id='final_sum'>{$this->final_sum}</b></span>元</b></td>
						</tr>
					</table>
				</div>
				<p class="m_10 t_r"><input type="submit" class="submit_order" /></p>
			</div>
		</div>
	</form>
</div>