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

//DOM加载完毕
$(function(){
	//虚拟商品更新
	orderFormInstance.goodsType("{$this->goodsType}");



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

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

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

<section class="breadcrumb">
	<span>您当前的位置：</span> <a href="{url:}">首页</a> » 填写核对订单信息
</section>

<section class="cart_2">
	<header class="cart_header">填写核对订单信息</header>
	<form action='{url:/simple/cart3}' method='post' name='order_form' onsubmit='return orderFormInstance.isSubmit()'>

		<section class="cart_item" id="addressBox">
			<h3>收货人信息</h3>
			<div class="cart_item_addr">
				<h4>常用收货地址</h4>
				<ul class="addr_list" id="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']} {$item['province_str']} {$item['city_str']} {$item['area_str']} {$item['address']} {$item['mobile']}
						</label>
						[<span onclick="orderFormInstance.addressEdit({$item['id']})">修改地址</span>]
						[<span onclick="orderFormInstance.addressDel({$item['id']})">删除</span>]
					</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']%> <%=item['province_str']%> <%=item['city_str']%> <%=item['area_str']%> <%=item['address']%> <%=item['mobile']%></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>

            {if:$this->takeselfList}
			<div class="cart_item_addr" style="margin-top:10px">
			    <h4>门店自提点</h4>
				<ul class="addr_list" id="takeself_list">
					{foreach:items=$this->takeselfList}
					<input type='hidden' name='accept_name' value='{$item['accept_name']}' />
					<input type='hidden' name='accept_mobile' value='{$item['accept_mobile']}' />
					<li>
						<label><input class="radio" name="takeself" type="radio" value="{$item['id']}" onclick="orderFormInstance.takeselfSelected({$item['id']});" />{$item['name']} {$item['province_str']} {$item['city_str']} {$item['area_str']} {$item['address']} {$item['accept_name']} {$item['accept_mobile']}</label> [<a href="javascript:orderFormInstance.selectTakeself({$item['id']});" style="color:#005ea7;">修改自提点</a>]
					</li>
					{/foreach}
				</ul>

				<!--门店自提点模板-->
				<script type='text/html' id='takeselfLiTemplate'>
				<input type='hidden' name='accept_name' value='<%=item['accept_name']%>' />
				<input type='hidden' name='accept_mobile' value='<%=item['accept_mobile']%>' />
				<li>
					<label><input class="radio" name="takeself" type="radio" value="<%=item['id']%>" onclick="orderFormInstance.takeselfSelected(<%=item['id']%>);" /><%=item['name']%> <%=item['province_str']%> <%=item['city_str']%> <%=item['area_str']%> <%=item['address']%> <%=item['accept_name']%> <%=item['accept_mobile']%></label> [<a href="javascript:orderFormInstance.selectTakeself(<%=item['id']%>);" style="color:#005ea7;">修改自提点</a>]
				</li>
				</script>
			</div>
			{/if}
		</section>

		<!--联系人 开始-->
		{set:$contact = $this->addressList ? $this->addressList[0] : []}
		<section class="cart_item" id="contactBox" style="display:none;">
			<h3>联系人信息</h3>
			<div class="cart_item_express">
    			<table>
    				<tr>
    				    <th>真实姓名：</th><td><input class='input_text' type='text' name='accept_name' pattern='required' value='{$contact['accept_name']}' /></td>
    				    <th>手机号码：</th><td><input class='input_text' type='text' name='accept_mobile' pattern='mobi' value='{$contact['mobile']}' /></td>
    				</tr>
    			</table>
		    </div>
		</section>
		<!--联系人 结束-->

		<!--服务时间 开始-->
		<section class="cart_item" id="preorderBox" style="display:none;">
			<h3>
				<span class="orange">选择日期</span>
			</h3>

            <div class="cart_item_express">
    			<table>
    				<colgroup>
    					<col width="120px" />
    					<col />
    				</colgroup>
    				<tr>
    			        <th>预订日期：</th>
    			        <td><input type='text' class='input_text Wdate' autocomplete='off' id='start_date' name='start_date' onFocus="WdatePicker({'minDate':'%y-%M-%d','maxDate':'#F{ $dp.$D(\'end_date\',{d:-1}) }'})" value="" pattern='date' onchange='orderFormInstance.preorder();' placeholder='起始日期' /> —— <input id='end_date' autocomplete='off' type='text' class='input_text Wdate' name='end_date' onFocus="WdatePicker({'minDate':'#F{ $dp.$D(\'start_date\',{d:1}) }','maxDate':'#F{ $dp.$D(\'start_date\',{d:30}) }'})" value="" pattern='date' onchange='orderFormInstance.preorder();' placeholder='结束日期' /></td>
    				</tr>
    				<tr>
    				    <th>预约价格：</th>
    				    <td>
    				        <ul id="preorderDetail"></ul>
    				    </td>
    				</tr>
    			</table>
		    </div>
		</section>
		<!--服务时间 结束-->

		<section class="cart_item" id="deliveryBox">
			<h3>配送方式</h3>
			<div class="cart_item_express">
				<table>
					<col width="180">
					<col>
					<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']}
							</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>


					<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>
		</section>
		<section class="cart_item" id="paymentBox">
			<h3>支付方式</h3>
			<div class="cart_item_pay">
				<table>
					<col width="320px">
					<col>
					{foreach:items = Api::run('getPaymentList')}
					<tr>
						<th>
							<label>
								<input class="radio" name="payment"  title="{$item['name']}" type="radio" value="{$item['id']}" />
								<img src='{url:plugins$item['logo']}' width='160px' />
								{$item['name']}
							</label>
						</th>
						<td>{$item['note']} </td>
					</tr>
					{/foreach}
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>订单附言</h3>
			<div class="cart_item_msg">
				<table>
					<col width="120px">
					<col>
					<tr>
						<th>订单附言：</th>
						<td><input class="input_text" type="text" name='message' /></td>
					</tr>
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>购买的商品</h3>
			<div class="cart_prompts {if:empty($this->promotion)}none{/if}">
				<strong>恭喜，您的订单已经满足了以下优惠活动！</strong>
				<ol>
					{foreach:items = $this->promotion}
					<li>{$item['plan']}，{$item['info']}</li>
					{/foreach}
				</ol>
			</div>
			<div class="cart_item_goods">
				<table>
					<col width="115">
					<col>
					<col width="80">
					<col width="80">
					<col width="80">
					<col width="80">
					<col width="80">
					<thead>
						<tr>
							<th>图片</th>
							<th>商品名称</th>
							<th>赠送积分</th>
							<th>单价</th>
							<th>优惠</th>
							<th>数量</th>
							<th>小计</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']}"></td>
							<td>
								<a href="{url:/site/products/id/$item['goods_id']}" class="blue">{$item['name']}</a>
								{if:isset($item['spec_array'])}
								<p>
								{set:$spec_array=goods_class::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><em>￥{$item['sell_price']}</em></td>
							<td>减￥{$item['reduce']}</td>
							<td>{$item['count']}</td>
							<td id="deliveryFeeBox_{$item['goods_id']}_{$item['product_id']}_{$item['count']}"><em>￥{$item['sum']}</em></td>
						</tr>
						{/foreach}
						<!-- 商品展示 结束-->
					</tbody>
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>结算信息</h3>
			<div class="cart_item_count">
				<div class="count">
					{if:$this->final_sum != $this->sum}优惠后总金额{else:}商品总金额{/if}：<strong id='goodsSum'>{$this->final_sum}</strong> -
					优惠券：<strong name='ticket_value'>0</strong> +
					税金：<strong id='tax_fee'>0</strong> +
					运费总计：<strong id='delivery_fee_show'>0</strong> +
					保价：<strong id='protect_price_value'>0</strong>
					{if:$this->spend_point > 0} + 消耗积分：<strong>{$this->spend_point}</strong>{/if}
					<br>
					<div class="use_ticket_btn" onclick="orderFormInstance.ticketShow()">
						<i class="fa fa-tag"></i>
						<span>{if:$this->ticketRow}有可用优惠券{else:}无可用优惠券{/if}</span>
					</div>
				</div>
				<table>
					<col width="220">
					<col>
					<col width="250">
					<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='none'>
								<select name="invoice_id" class="input_select">
									<option value="">请选择发票...</option>
									{foreach:items=Api::run("getInvoiceListByUserId")}
									<option value="{$item['id']}">{$item['company_name']}</option>
									{/foreach}
								</select>
								<a href="javascript:orderFormInstance.editInvoice();">【添加】</a>
							</label>
						</td>
						<td>
							<div class="all_count">
								应付总额：<em>￥<span id='final_sum'>{$this->final_sum}</span></em> 元
							</div>
						</td>
					</tr>
				</table>
			</div>
		</section>
		<label class="cart_topay_btn">
			<input type="submit">
			<span>确定无误，提交订单</span>
		</label>
	</form>
</section>
