<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta content="zh-cn" http-equiv="Content-Language" />
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="renderer" content="webkit"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,  user-scalable=no"/>
		<title>{%$lngpack.sitename%}</title>
		<meta name="keywords" content="{%$lngpack.keyword%}" />
		<meta name="description" content="{%$lngpack.description%}" />
		<link rel="icon" type="image/png" href="{%$icon_16%}" sizes="16x16"/>
		<link rel="icon" type="image/png" href="{%$icon_32%}" sizes="32x32"/>
		<link rel="icon" type="image/png" href="{%$icon_64%}" sizes="64x64"/>
		<link href="{%$rootpath%}css/bootstrap.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_font.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/swiper.min.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_all.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcms_p8_public.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/jquery.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/bootstrap.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/swiper.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_base.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_dialog.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/citydb.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/cityselect.js"></script>
	</head>

	<body>
		{%link file="public/head.html"%}
		<section class="bann_container">
			<div class="container page_bann_title">
				<h2>购物车</h2>
			</div>
		</section>

		<section class="container espcms_page_book">
			{%if $out=='order_list'%}
			<script type="text/javascript">
				$(window).load(function () {
					order_amount();
					order_del();
					$("#order_list").espcms_formvalidation({display_type: "top", display_icon_err: false});
				});
			</script>
			<div class="section-divider mb40"><span>确认订购产品或服务</span></div>
			{% if count($array) > 0 %}
			<form name="order_list" method="post" id="order_list" class="form-horizontal admin-form" action="{%$order_link.settlement%}">
				<input type="hidden" name="product_total" id="product_total" value="{%$product_total%}"/>
				<input type="hidden" name="order_del_url" id="order_del_url" value="{%$order_link.del%}"/>
				<table class="table table-bordered tc">
					<thead class="contrast_th">
						<tr class="info">
							<th class="tc f16">产品或服务名称</th>
							<th class="tc f16">订购价格</th>
							<th class="tc f16">数量</th>
							<th class="tc f16">小计</th>
							<th class="tc f16">操作</th>
						</tr>
					</thead>
					<tbody class="contrast_td">
						{%forlist from=$array key=i%}
						<tr>
							<td class="tc">{%$array[i].title%}</td>
							<td class="tr">
								{%$array[i].bprice|espcms_format_money(3)%}
								<input type="hidden" name="bprice[]" value="{%$array[i].bprice%}"/>
								<input type="hidden" name="did[]" value="{%$array[i].did%}"/>
							</td>
							<td class="tc">
								<input type="text" name="amount[]" id="amount{%$array[i].did%}" value="{%$array[i].amount%}" data-id="{%$array[i].did%}" data-p="{%$array[i].bprice%}" size="2" maxlength="5" class="form-control amount" data-validation="^[1-9]{1}[\d]*$" placeholder="请填写数量" title="请填写数量" data-validation-msg="抱歉：数量输入错误，请输入大于0的整数字符！"/>
							</td>
							<td class="tr">
								<span id="countprice_str_{%$array[i].did%}">{%$array[i].countprice|espcms_format_money(3)%}</span>
								<input type="hidden" class="countprice" name="countprice[]" id="countprice{%$array[i].did%}" value="{%$array[i].countprice%}">
							</td>
							<td class="tc"><button type="button" class="btn btn-orange delete_item" data-id="{%$array[i].did%}">删除</button></td>
						</tr>
						{%/forlist%}
						<tr>
							<td colspan="16" class="tr"><span class="text-orange">合计金额：<span id="product_total_str">{%$product_total|espcms_format_money(3)%}</span></span></td>
						</tr>
						<tr>
							<td colspan="10" class="pt20 pb20">
								<div class="col-sm-6 p0 tl"><button class="btn btn-lightgray delete_all_item" type="button"/>清空购物车</button></div>
								<div class="col-sm-6 p0 tr"><button class="btn btn-green" type="submit" formmethod="POST"/>去结算</button></div>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
			{%else%}
			<div class="tc">
				<h3>非常抱歉亲，您还没有选择订购产品！</h3>
			</div>
			{%/if%}
			{%elseif $out=='order_edit'%}
			<script type="text/javascript">
				$(function () {
					{%if $member_con.MEMBER_CITY_VERIFY==1%}
					$("#city_select").citySelect({
						prov: "{%if $member.province%}{%$member.province%}{%else%}北京{%/if%}",
						city: "{%$member.city%}",
						dist: "{%$member.district%}",
						nodata: "none"
					});
					{%/if%}
					$("#order_list").espcms_formvalidation({display_icon_err: false});

					load_tabclick('.tab_click');
					conpon_check();
				});
			</script>
			<form name="order_list" method="post" id="order_list" class="form-horizontal admin-form" action="{%$order_link.save%}">
				<input type="hidden" name="tokenname" value="{%$tokenkey.token_name%}"/>
				<input type="hidden" name="tokenkey" value="{%$tokenkey.token_key%}"/>
				<input type="hidden" name="userid" id="userid" value="{%$member.userid%}"/>
				<input type="hidden" name="productmoney" id="productmoney" value="{%$product_total%}"/>
				<div class="section-divider mb40"><span>填写订单信息</span></div>
				<div class="form-group">
					<div class="col-sm-12">
						<table class="table table-striped table-bordered tc">
							<thead class="contrast_th">
								<tr class="info">
									<th class="tc">产品或服务名称</th>
									<th class="tc">编号</th>
									<th class="tc">数量</th>
									<th class="tr">单价</th>
									<th class="tr">小计</th>
								</tr>
							</thead>
							<tbody class="contrast_td">
								{%forlist from=$array key=i%}
								<tr>
									<td class="tc">
										<input type="hidden" name="product_item_price[]" value="{%$array[i].bprice%}"/>
										<input type="hidden" name="products_oprice[]" value="{%$array[i].oprice%}"/>
										<input type="hidden" name="products_id[]" class="products_id" data-tid="{%$array[i].tid%}" value="{%$array[i].did%}"/>
										<input type="hidden" name="products_tid[]" class="products_tid" value="{%$array[i].tid%}"/>
										<input type="hidden" name="products_name[]" value="{%$array[i].title%}"/>
										<input type="hidden" name="products_tsn[]" value="{%$array[i].tsn%}"/>
										<input type="hidden" name="istype[]" value="{%$array[i].type%}"/>
										{%$array[i].title%}
									</td>
									<td class="tc">{%$array[i].tsn%}</td>
									<td class="tc">{%$array[i].amount%}<input type="hidden" name="product_item_qty[]" id="amount_{%$array[i].did%}" value="{%$array[i].amount%}"></td>
									<td class="tr">
										{%$array[i].bprice|espcms_format_money(3)%}
									</td>
									<td class="tr">{%$array[i].countprice|espcms_format_money(3)%}<input type="hidden" name="product_item_total[]" id="countprice_{%$array[i].did%}" value="{%$array[i].countprice%}"></td>
								</tr>
								{%/forlist%}
								<tr>
									<td colspan="16" class="tr pb10">
										<span class="colorgreg">合计金额：{%$product_total|espcms_format_money(3)%}<span class="discount_div displaynone"></span></span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>

				{%if $order_con.ORDER_ISOPID==0%}
				<div class="form-group">
					<label class="col-sm-2 control-label">配送方式</label>
					<div class="col-sm-9 pt6">
						{%forlist from=$shipplug key=i%}
						<input type="radio" name="osid" value="{%$shipplug[i].osid%}"{%if key=>i==1%} checked{%/if%} /> {%$shipplug[i].shippingname%}
							{%if $shipplug[i].price>0%}运费：{%$shipplug[i].price%} {%/if%}{%$shipplug[i].content%}
							{%/forlist%}
					</div>
				</div>
				{%else%}
				<input type="hidden" name="osid" value="{%$order_con.ORDER_OPID%}"/>
				{%/if%}
				<input type="hidden" name="paytype" id="paytype" value="2"/>
				{%if $coupon_app.isetup && $coupon_app.isopen%}
				<input type="hidden" name="check_coupon_link" id="check_coupon_link" value="{%$check_coupon_link%}"/>
				<input type="hidden" name="discount" id="discount" value="0"/>
				<div class="form-group">
					<label class="col-sm-2 control-label">优惠卷编号</label>
					<div class="col-sm-9">
						<input type="text" name="ocdsn" id="ocdsn" class="form-control" data-isvalidation="true" data-validation="^[\w-]+$" placeholder="请填写优惠卷编号" title="请填写优惠卷编号" data-validation-msg="抱歉：优惠卷编号输入错误，请返回重新输入！"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<a target="_blank" class="btn btn-success" href="{%$uncoupon_link%}">查看优惠卷</a>
					</div>
				</div>
				{%/if%}

				<div class="form-group">
					<label class="col-sm-2 control-label">收货人姓名</label>
					<div class="col-sm-9"><input type="text" name="consignee" value="{%$member.alias%}" class="form-control" data-validation-minlength="4" data-validation-maxlength="50" placeholder="请填写订单收货人真实姓名" title="请填写订单收货人真实姓名" data-validation-msg="抱歉：收货人真实姓名输入错误，请返回重新输入！"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">E-mail</label>
					<div class="col-sm-9"><input type="text" name="email" value="{%$member.email%}" class="form-control" data-validation="^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"  placeholder="请输入E-mail" title="请输入E-mail" data-validation-msg="抱歉：E-mail输入错误，请重新输入！"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">手机</label>
					<div class="col-sm-9"><input type="text" name="mobile" value="{%$member.mobile%}" class="form-control" data-validation="^1[\d]{10}$" placeholder="请输入11位手机号" title="请输入11位手机号" data-validation-msg="抱歉：手机号输入错误，请重新输入！"/> </div>
				</div>
				{%if $member_con.MEMBER_CITY_VERIFY==1%}
				<div class="form-group">
					<label class="col-sm-2 control-label">地区</label>
					<div class="col-sm-9">
						<div id="city_select">
							<div class="col-sm-3 p0">
								<select class="form-control prov" name="province"></select>
							</div>
							<div class="col-sm-3 p0 pl5">
								<select class="form-control city" name="city" disabled="disabled"></select>
							</div>
							<div class="col-sm-3 pl5">
								<select class="form-control dist" name="district" disabled="disabled"></select>
							</div>
						</div>
					</div>
				</div>
				{%/if%}

				<div class="form-group">
					<label class="col-sm-2 control-label">详细地址</label>
					<div class="col-sm-9"><input type="text" name="address" value="{%$member.address%}" class="form-control" data-validation-minlength="4" data-validation-maxlength="200" placeholder="请填写订单详细地址" title="请填写订单详细地址" data-validation-msg="抱歉：订单详细地址输入错误，请返回重新输入！"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">索取发票</label>
					<div class="col-sm-9 pt6">
						<input type="radio" name="isinvoice" class="tab_click" open_list=".isinvoice_div" value="1"/> 需要&nbsp;
						<input type="radio" name="isinvoice" class="tab_click" close_list=".isinvoice_div" value="0" checked/> 不需要
					</div>
				</div>
				<div class="form-group isinvoice_div displaynone">
					<label class="col-sm-2 control-label">发票全称</label>
					<div class="col-sm-9">
						<input type="text" name="invpayee" class="form-control" link-validation="isinvoice" link-gettype="radio" link-getvalue="1" data-validation-minlength="4" data-validation-maxlength="200" placeholder="请输入发票全称，长度为2至150个以内任意字符" title="请输入发票全称，长度为2至150个以内任意字符" data-validation-msg="抱歉，发票全称填写错误，请填写长度2至150位的任意字符！"/>
					</div>
				</div>
				<div class="form-group isinvoice_div displaynone">
					<label class="col-sm-2 control-label">企业证号</label>
					<div class="col-sm-9"><input type="text" name="companysn" id="companysn" class="form-control" link-validation="isinvoice" link-gettype="radio" link-getvalue="1" data-validation-minlength="5" data-validation-maxlength="50" placeholder="请输入企业证号（建议填写五证合一或者公司营业执照号），字符长度由2至50位以内的字母和数字字符组成" title="请输入企业证号（建议填写五证合一或者公司营业执照号），字符长度由2至50位以内的字母和数字字符组成" data-validation-msg="抱歉，证件号码填写错误，请填写长度2至50位以内的字母和数字字符！" /></div>
				</div>
				<div class="form-group isinvoice_div displaynone">
					<label class="col-sm-2 control-label">发票内容</label>
					<div class="col-sm-9 pt6">
						<input type="text" name="invcontent" class="form-control" link-validation="isinvoice" link-gettype="radio" link-getvalue="1" data-validation-minlength="4" data-validation-maxlength="200" placeholder="请输入发票内容，长度为2至150个以内任意字符" title="请输入发票内容，长度为2至150个以内任意字符" data-validation-msg="抱歉，发票内容填写错误，请填写长度2至150位的任意字符！"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注</label>
					<div class="col-sm-9">
						<textarea class="form-control" style="width:100%;height:120px" name="content" id="content" maxlength="800" data-isvalidation="true" data-validation-minlength="4" data-validation-maxlength="200" placeholder="请输入订单备注，长度不超过500个以内任意字符" title="请输入订单备注，长度不超过500个以内任意字符" data-validation-msg="抱歉，订单备注输入错误，请输入长度不超过500个以内的任意字符！"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<button class="btn btn-orange" type="submit" formmethod="POST"/>提交订单</button>
					</div>
				</div>
			</form>

			{%elseif $out=='edit_buyok'%}
			<div class="section-divider mb40"><span>订单提交成功</span></div>
			<p class="bg-danger p10 tc">请您选择以下支付方式，如在支付过程中遇到任何问题，可以随时与我们联系！</p>
			<div class="tc">
				<h3>恭喜，您的订单已提交成功，请记住您的订单号：<span class="colorgreg b">{%$read.ordersn%}</span></h3>
				<h5 class="pt15">订单总额：<span class="colorgreg">{%$read.orderamount|espcms_format_money(3)%}</span>（产品总额{%$read.productmoney|espcms_format_money(3)%}{%if $read.shippingmoney>0%} + 快递费{%$read.shippingmoney|espcms_format_money(3)%}{%/if%}{%if $read.invoicefeemoney>0%} + 发票手续费：{%$read.invoicefeemoney|espcms_format_money(3)%}{%/if%}{%if $read.discount>0%} - 优惠{%$read.discount|espcms_format_money(3)%}{%/if%}）</h5>
			</div>
			{%if $read.paytype==2 && count($pay_plug_list)>0%}
			<div class="tc mt30 mb30">
				{%forlist from=$pay_plug_list key=i%}
				<span class="pay_ico"><a href="{%$pay_plug_list[i].pay_link%}" title="{%$pay_plug_list[i].payname%}"><img src="{%$rootdir%}{%$pay_plug_list[i].paypic%}"/></a></span>
				{%/forlist%}
			</div>
			{%/if%}
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">会员中心</a>  <a class="btn btn-success btn-shadow" href="{%$member_order_link%}">查看订单</a>
			</div>
			{%/if%}

			{%elseif $out=='pay_no'%}
			<div class="section-divider mb40"><span>订单支付</span></div>
			<p class="bg-danger p10 tc">请您选择以下支付方式，如在支付过程中遇到任何问题，可以随时与我们联系！</p>
			<div class="tc">
				<h3>所属订单号：<span class="colorgreg b">{%$read.ordersn%}</span></h3>
				<h5 class="pt15">订单总额：<span class="colorgreg">{%$read.orderamount|espcms_format_money(3)%}</span>（产品总额{%$read.productmoney|espcms_format_money(3)%}{%if $read.shippingmoney>0%} + 快递费{%$read.shippingmoney|espcms_format_money(3)%}{%/if%}{%if $read.invoicefeemoney>0%} + 发票手续费：{%$read.invoicefeemoney|espcms_format_money(3)%}{%/if%}{%if $read.discount>0%} - 优惠{%$read.discount|espcms_format_money(3)%}{%/if%}）</h5>
			</div>
			{%if $read.paytype==2 && count($pay_plug_list)>0%}
			<div class="tc mt30 mb30">
				{%forlist from=$pay_plug_list key=i%}
				<span class="pay_ico"><a href="{%$pay_plug_list[i].pay_link%}" title="{%$pay_plug_list[i].payname%}"><img src="{%$rootdir%}{%$pay_plug_list[i].paypic%}"/></a></span>
				{%/forlist%}
			</div>
			{%/if%}
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">会员中心</a>  <a class="btn btn-success btn-shadow" href="{%$member_order_link%}">查看订单</a>
			</div>
			{%/if%}

			{%elseif $out=='pay_ok'%}
			<div class="section-divider mb40"><span>支付成功</span></div>
			<p class="bg-danger p10 tc">以下是您的订单支付信息，如有疑问可以随时与我联系！</p>
			<div class="tc">
				<h3>恭喜，当前订单 <span class="colorgreg b">{%$read.ordersn%}</span> 已支付成功！</h3>
				<h4 class="pt15">支付总金额为：{%$read.orderamount|espcms_format_money(3)%}</h4>
			</div>
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">会员中心</a>  <a class="btn btn-success btn-shadow" href="{%$member_order_link%}">查看订单</a>
			</div>
			{%/if%}
			{%/if%}
		</section>

		{%link file="public/footer.html"%}
	</body>
</html>