名称: orders_checkout
功能: 订单确认接口-POST数据提交
参数: ① orders_id 订单编号(默认若没有传递此参数则优先从$_SESSION会话中提取) ② address_id 收货地址编号 ③ notes 订单备注 ④ pay_type 付款类型
示例:
<div class="col-md-12 col-sm-12"> <h1>确认订单</h1> <form action="" method="post" onsubmit="ecms.ajaxForm(this, apps['orders-checkout'], false);return false;"> <input type="hidden" name="act" value="orders_checkout" /> <div class="clearfix"> <div class="table-wrapper-responsive"> {if($orders_info['goods_info'])} <table class="table table-bordered"> <tr> <th class="shopping-cart-description">商品</th> <th class="shopping-cart-quantity">数量</th> <th class="shopping-cart-price">单价</th> <th class="shopping-cart-total" colspan="2">金额</th> </tr> {loop $orders_info['goods_info'] $k1 $v1} <tr> <td class="shopping-cart-description"> <p>{$v1['goods_name']}</p> <p><strong>Item 1</strong> - Color: Green; Size: S</p> <em>More info is here</em> </td> <td class="shopping-cart-quantity">{$v1['goods_num']}</td> <td class="shopping-cart-price"><strong><span>$</span>{$v1['goods_price']}</strong></td> <td class="shopping-cart-total"><strong><span>$</span>{php}echo round($v1['goods_price']*$v1['goods_num'],2);{/php}</strong></td> </tr> {/loop} <tr><td colspan="4" align="right" style="font-size: 16px;"> 商品金额<strong class="price"><span>$</span>{$orders_info['orders_info']['orders_money']}</strong>, 物流运费<strong class="price"><span>$</span>{$orders_info['freight']}</strong> 订单金额<strong class="price"><span>$</span>{$orders_info['pay_money']}</strong> </th></td> </table> {else} <script>window.top.location.href='shopping-cart.html';</script> {/if} </div> <div class="col-md-12 col-sm-12 margin-b-5"> <p>收货地址:</p> <select name="address_id" class="form-control"> {if($address_list)} {loop $address_list $k $v} <option value="{$v['id']}" {php}if($orders_info['orders_info']['address_id']==$v['id']){echo 'selected="selected"';}{/php}>{$v['address']} {$v['username']} {$v['phone']}</option> {/loop} {/if} </select> </div> <div class="col-md-12 col-sm-12 margin-bottom-40"> <p>订单备注:</p> <textarea class="col-md-12 col-sm-12 form-control" rows="2" placeholder="请在此处填写订单备注信息..." name="notes">{$orders_info['orders_info']['notes']?$orders_info['orders_info']['notes']:''}</textarea> </div> </div> <a class="btn btn-default pull-left" href="/">返回购物车 <i class="fa fa-shopping-cart"></i></a> <input class="btn btn-primary pull-right" type="submit" value="确认&付款" /> </form> </div>
apps['orders-checkout'] = function(d){ if( typeof(d.status)!='undefined' && d.status=='yes' ){ if( typeof(d.data.payment_url)!='undefined' && d.data.payment_url ){ window.top.location.href = d.data.payment_url; return true; } } alert('提交失败'); return false; };