名称: address_edit
功能: 地址信息编辑接口,用于接收前端提交的地址信息(添加、编辑),只需要在表单POST请求里添加 【act=address_edit】, 完整的地址表单信息请参考【数据字典】
调用示例:
<form class="form form-horizontal" action="" method="post" onsubmit="ecms.ajaxForm(this, apps['address_edit_callback'], false);return false;"> <input type="hidden" name="act" value="address_edit"> <input type="hidden" name="id" value="0"> <table class="table table-bordered"> <tr><th colspan="2">编辑收货地址</th></tr> <tr> <th width="100">邮政编码</th> <td><input type="text" name="postalCode" class="form-control" /></td> </tr> <tr> <th width="100">联系电话</th> <td><input type="text" name="phone" class="form-control" /></td> </tr> <tr> <th width="100">收货人</th> <td><input type="text" name="username" class="form-control" /></td> </tr> <tr> <th width="100">收货地址</th> <td> <!-- "countryCode state city line1 line2 --> <select name="countryCode" class="form-control width-auto pull-left margin-r-5 margin-b-5" title="国家代码"> {if($CountryCode)} {loop $CountryCode $k $v} <option value="{$v['countryCode']}">{$v['countryCode']} - {$v['country_cn']}</option> {/loop} {/if} </select> <input type="text" name="state" class="form-control width-auto pull-left margin-r-5 margin-b-5" value="" title="省份" placeholder="省份" /> <input type="text" name="city" class="form-control width-auto pull-left margin-r-5 margin-b-5" value="" title="城市" placeholder="城市" /> <input type="text" name="line1" class="form-control width-auto pull-left margin-r-5 margin-b-5" value="" title="街道" placeholder="街道" /> <input type="text" name="line2" class="form-control width-auto pull-left margin-r-5 margin-b-5" value="" title="门牌号" placeholder="门牌号" /> </td> </tr> <tr> <th width="100">设为默认</th> <td> <select name="is_default" class="form-control width-auto"> <option value="0">否</option> <option value="1">是</option> </select> </td> </tr> <tr> <th></th> <td> <input type="reset" value="重置" class="btn btn-default" > <input type="submit" value="提交" class="btn btn-success" > </td> </tr> </table> </form>
提交参数参考:
Array ( [id] => 4 [user_id] => 1 [username] => xxx [line1] => 罗湖区国贸 [line2] => 佳宁娜B栋 [city] => 深圳市 [state] => 广东省 [phone] => 13888888888 [postalCode] => 435400 [countryCode] => CN [is_default] => 1 [address] => CN 广东省 深圳市 罗湖区国贸 佳宁娜B栋 )