opchangeaddress.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  2. <style type='text/css'>
  3. .select-group {height: 28px;padding-top:2px;}
  4. </style>
  5. <form class="form-horizontal form-validate" action="{:U('order/opchangeaddress')}" method="post" enctype="multipart/form-data">
  6. <input type='hidden' name='id' value='{$id}' />
  7. <div class="modal-dialog">
  8. <div class="modal-content">
  9. <div class="modal-header">
  10. <button data-dismiss="modal" class="close" type="button">×</button>
  11. <h4 class="modal-title">编辑收货信息</h4>
  12. </div>
  13. <div class="modal-body">
  14. <div class="form-group">
  15. <label class="col-sm-2 control-label">收货人 :</label>
  16. <div class="col-sm-9 col-xs-12">
  17. <input type="text" name="realname" class="form-control" value="{$item['shipping_name']}" data-rule-required='true' />
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label class="col-sm-2 control-label">手机 :</label>
  22. <div class="col-sm-9 col-xs-12">
  23. <input type="text" name="mobile" class="form-control" value="{$item['shipping_tel']}" data-rule-required='true' />
  24. </div>
  25. </div>
  26. <div class="form-group dispatch_info">
  27. <label class="col-sm-2 control-label">修改地址 :</label>
  28. <div class="col-sm-9 col-xs-12">
  29. <label class="radio-inline"><input type="radio" name="changead" value="0" checked="true"/> 否</label>
  30. <label class="radio-inline"><input type="radio" name="changead" value="1" /> 是</label>
  31. <span class="help-block"></span>
  32. </div>
  33. </div>
  34. <div class="form-group ad-group" style="display: none;">
  35. <label class="col-sm-2 control-label">地址 :</label>
  36. <div class="col-sm-9 col-xs-12">
  37. <span class="help-block">{$item['shipping_address']}</span>
  38. </div>
  39. </div>
  40. <div class="form-group ad-group" style="display: none;">
  41. <label class="col-sm-2 control-label">新地址 :</label>
  42. <div class="col-sm-9 col-xs-12">
  43. <p>
  44. <select id="sel-provance" name="province" onChange="selectCity();" class="select form-control select-group" style="width:123px;display:inline;">
  45. <option value="" selected="true">省/直辖市</option>
  46. </select>
  47. <select id="sel-city" name="city" onChange="selectcounty(0)" class="select form-control select-group" style="width:135px;display:inline;">
  48. <option value="" selected="true">请选择</option>
  49. </select>
  50. <select id="sel-area" name="area" onChange="selectstreet(0)" class="select form-control select-group" style="width:130px;display:inline;">
  51. <option value="" selected="true">请选择</option>
  52. </select>
  53. </p>
  54. <input type="text" name="address" id="address_detail" class="form-control" value="{$item['shipping_address']}" data-rule-required='true' />
  55. </div>
  56. </div>
  57. </div>
  58. <div class="modal-footer">
  59. <button class="btn btn-primary" id="sub_form" type="submit">保存</button>
  60. <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
  61. </div>
  62. </div>
  63. </div>
  64. </form>
  65. <script language="javascript">
  66. $(function () {
  67. $(':radio[name=changead]').click(function () {
  68. var type = $("input[name='changead']:checked").val();
  69. if (type == '1') {
  70. $('.ad-group').show();
  71. } else {
  72. $('.ad-group').hide();
  73. }
  74. });
  75. $('#sub_form').click(function(){
  76. var type = $("input[name='changead']:checked").val();
  77. if(type == 1)
  78. {
  79. var provance = $('#sel-provance').val();
  80. var city = $('#sel-city').val();
  81. var area = $('#sel-area').val();
  82. if( provance == '请选择省份' )
  83. {
  84. alert('请选择省份');
  85. return false;
  86. }
  87. if( area == '市辖区' )
  88. {
  89. alert('请选择市辖区');
  90. return false;
  91. }
  92. }
  93. var address_detail = $('#address_detail').val();
  94. if( address_detail == '' )
  95. {
  96. alert('请填写详细地址');
  97. return false;
  98. }
  99. })
  100. })
  101. //opchangeaddress
  102. cascdeInit("0","{php echo $item['shipping_address']}","{php echo isset($province_info['name'])?$province_info['name']:''}","{php echo isset($city_info['name'])?$city_info['name']:''}","{php echo isset($area_info['name'])?$area_info['name']:''}","{php echo '';");
  103. // cascdeInit("1","1","{$item['province_name']}","{$item['city_name']}","{$item['area_name']}","{$item['country_name']}");
  104. </script>