123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- {extend name="default/base/base_member" /}
- {block name="member_main"}
- <div class="eject_con">
- <div class="adds">
- <div class="alert alert-success">
- <ul>
- <li>{$Think.lang.address_description}</li>
- </ul>
- </div>
- <div id="warning"></div>
- <form method="post" action="{:url('Memberaddress/chain_add')}" id="address_form" target="_parent">
- <input type="hidden" name="address_id" value="{$address_info.address_id|default=''}" />
- <dl>
- <dt><i class="required">*</i>{$Think.lang.region_selection}:</dt>
- <dd>{$Think.lang.find}
- <span>
- <input type="hidden" value="{$address_info.city_id|default=''}" name="city_id" id="_area_2">
- <input type="hidden" value="{$address_info.area_id|default=''}" name="area_id" id="_area">
- <input type="hidden" name="area_info" id="region" value="{$address_info.area_info|default=''}"/>
-
- </span>{$Think.lang.scope_since_mention_service}。
- </dd>
- </dl>
- <div class="dsmc-chain">
- <div id="zt_address"></div>
- <div class="chain-map" id="container" style="height:250px;width:250px"></div>
- </div>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.name_of_consignee}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="text w100" name="true_name" value="{$address_info.address_realname|default=''}"/>
- <p class="hint"></p>
- </dd>
- </dl>
- <dl>
- <dt>{$Think.lang.consignee_number}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="text w200" name="tel_phone" value="{$address_info.address_tel_phone|default=''}"/>
- <p class="hint">{$Think.lang.area_code_extension}</p>
- </dd>
- </dl>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.mobile_phone}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="text w200" name="mob_phone" value="{$address_info.address_mob_phone|default=''}"/>
- </dd>
- </dl>
- <div class="bottom">
- <input type="submit" class="submit" value="{$Think.lang.ds_common_button_save}" />
- <a class="dsm-btn ml5" href="javascript:DialogManager.close('daisou');">{$Think.lang.ds_cancel}</a>
- </div>
- </form>
- </div>
- </div>
- <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
- <!--{if $Think.config.ds_config.mapak_type eq '1'}-->
- <script type="text/javascript">
- window._AMapSecurityConfig = {
- securityJsCode:"{$Think.config.ds_config.gaode_jscode}",
- }
- </script>
- <script type="text/javascript" src="//webapi.amap.com/maps?v=2.0&key={$Think.config.ds_config.gaode_ak}"></script>
- <!--{else}-->
- <script type="text/javascript" src="{$Think.HTTP_TYPE}api.map.baidu.com/api?v=2.0&ak={{$Think.config.ds_config.baidu_ak}}"></script>
- <!--{/if}-->
- <script type="text/javascript">
- var map
- $(document).ready(function () {
- if({$Think.config.ds_config.mapak_type} == '1'){
- map = new AMap.Map("container");
- }else{
- map = new BMap.Map("container");
- }
-
- $("#region").ds_region();
- $('#address_form').validate({
- submitHandler: function (form) {
- if ($('input[type="radio"]:checked').size() == 1) {
- ds_ajaxpost('address_form');
- }
- },
- rules: {
- true_name: {
- required: true
- },
- tel_phone: {
- required: check_phone,
- minlength: 6,
- maxlength: 20
- },
- mob_phone: {
- required: check_phone,
- minlength: 11,
- maxlength: 11,
- digits: true
- }
- },
- messages: {
- true_name: {
- required: '{$Think.lang.please_fill_name_consignee}'
- },
- tel_phone: {
- required: '{$Think.lang.fill_least_one_phone}',
- minlength: '{$Think.lang.please_correct_fill_phone_number}',
- maxlength: '{$Think.lang.please_correct_fill_phone_number}'
- },
- mob_phone: {
- required: '{$Think.lang.fill_least_one_phone}',
- minlength: '{$Think.lang.please_fill_phone_number_correctly}',
- maxlength: '{$Think.lang.please_fill_phone_number_correctly}',
- digits: '{$Think.lang.please_fill_phone_number_correctly}'
- }
- },
- groups: {
- phone: 'tel_phone mob_phone'
- }
- });
- $('#address_form').on('change', 'select', function () {
- area_id = $('#address_form').find('select').last().val();
- if($("#address_form select:eq(1)").length>0 && $("#address_form select:eq(1) option:selected").val()!=''){
- var name=$("#address_form select:eq(1) option:selected").text();
- }
- if (area_id != '{$Think.lang.ds_please_choose}') {
- if({$Think.config.ds_config.mapak_type} == '1'){
- AMap.plugin("AMap.Geocoder", function () {
- var geocoder = new AMap.Geocoder({});
- geocoder.getLocation(name, function(status, result) {
- if(result.info == "OK"){
- var location = result.geocodes[0].location;
- var lng = location.lng;
- var lat = location.lat;
- map.panTo([lng, lat]);
- }
- });
- })
-
- }else{
- map.centerAndZoom($('#address_form').find('select').first().find('option:selected').text(), 15);
- }
-
- $('#zt_address').load("{$Think.HOME_SITE_URL}/memberaddress/chain_list.html?chain_id={$address_info.chain_id|default=''}&area_id=" + area_id);
- }
- });
- {if intval($Request.param.address_id)}
- $('#zt_address').load("{$Think.HOME_SITE_URL}/memberaddress/chain_list.html?chain_id={$address_info.chain_id|default=''}&area_id={$address_info.area_id|default=''}");
- {/if}
- });
- function check_phone() {
- return ($('input[name="tel_phone"]').val() == '' && $('input[name="mob_phone"]').val() == '');
- }
- </script>
- {/block}
|