zip_code_query.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('邮编查询'))
  4. <style>
  5. .bootstrap-select{width:0;padding:0;margin:0;}
  6. .dropdown-toggle .pull-left{margin:0;height:20px;line-height:20px;padding:0;margin:0}
  7. </style>
  8. <div id="app" class="w1200 m0a" style="height:100vh">
  9. <div class="rightlist">
  10. <form action="" method="post" class='form-horizontal'>
  11. <div class="form-group" style="padding-top: 50px;">
  12. <label class="col-xs-12 col-sm-3 col-md-2 control-label"> 地址链接</label>
  13. <div class="col-sm-8 col-xs-12">
  14. <el-tag style="width: 65%;font-size: 18px">[[code_url]]</el-tag>
  15. <el-button type="primary" @click="copy(code_url)">复制</el-button>
  16. </div>
  17. </div>
  18. {{-- <div class="form-group">--}}
  19. {{-- <label class="col-xs-12 col-sm-3 col-md-2 control-label">城市(区/县)</label>--}}
  20. {{-- <div class="col-sm-8 col-xs-12">--}}
  21. {{-- <select name='cityList' id="cityList" class='form-control diy-notice'>--}}
  22. {{-- <option value="" selected value="" >--}}
  23. {{-- 请选择--}}
  24. {{-- </option>--}}
  25. {{-- </select>--}}
  26. {{-- </div>--}}
  27. {{-- </div>--}}
  28. {{-- <div style="display:none" class="display" style="overflow: hidden;text-align: center;">--}}
  29. {{-- <p style="margin: auto;width:300px;" id="tips"></p>--}}
  30. {{-- <div id="code" style="height: 200px;width:250px;margin: auto;overflow:auto;overflow-y:scroll; "></div>--}}
  31. {{-- </div>--}}
  32. {{--</div>--}}
  33. </form>
  34. </div>
  35. </div>
  36. <script>
  37. var app = new Vue({
  38. el: '#app',
  39. delimiters: ['[[', ']]'],
  40. data() {
  41. return {
  42. code_url:'https://www.ems.com.cn/postcode'
  43. }
  44. },
  45. created() {
  46. },
  47. mounted() {
  48. },
  49. methods: {
  50. copy(url) {
  51. let oInput = document.createElement('input');
  52. oInput.value = url;
  53. document.body.appendChild(oInput);
  54. oInput.select(); // 选择对象;
  55. console.log(oInput.value);
  56. document.execCommand("Copy"); // 执行浏览器复制命令
  57. oInput.remove()
  58. this.$message({message: '复制成功', type: 'success'});
  59. },
  60. },
  61. });
  62. {{--let optionstring = '';--}}
  63. {{--let abc = '';--}}
  64. {{-- $('#provinces_id').change(function(){--}}
  65. {{-- let ul = $('.rewrite').find('div').children('ul');--}}
  66. {{-- let sel = $('.rewrite').find('#cityList');--}}
  67. {{-- console.log(sel)--}}
  68. {{-- var provinces_id= $(this).val();--}}
  69. {{-- $.ajax({--}}
  70. {{-- url: "{!! yzWebUrl('plugin.exhelper.admin.print-once.city') !!}",--}}
  71. {{-- type: "post",--}}
  72. {{-- data: {provinces_id: provinces_id},--}}
  73. {{-- cache: false,--}}
  74. {{-- success: function (data) {--}}
  75. {{-- console.log(data);--}}
  76. {{-- $.each(data.data,function(key,value){ //循环遍历后台传过来的json数据--}}
  77. {{-- abc += `<option value=`+value.cityCode+` >`+ value.cityName + `</option>`;--}}
  78. {{-- });--}}
  79. {{-- $('#cityList').append(abc);--}}
  80. {{-- }--}}
  81. {{-- })--}}
  82. {{-- console.log($(this).children('option:selected')[0].innerText)--}}
  83. {{-- });--}}
  84. {{-- $('#cityList').change(function(){--}}
  85. {{-- let zip_code = '';--}}
  86. {{-- var city_id= $(this).val();--}}
  87. {{-- var provinces_id= $('#provinces_id').val();--}}
  88. {{-- $.ajax({--}}
  89. {{-- url: "{!! yzWebUrl('plugin.exhelper.admin.print-once.query-post-code') !!}",--}}
  90. {{-- type: "post",--}}
  91. {{-- data: {city_id: city_id,provinces_id:provinces_id},--}}
  92. {{-- cache: false,--}}
  93. {{-- success: function (data) {--}}
  94. {{-- $.each(data.data,function(key,value){ //循环遍历后台传过来的json数据--}}
  95. {{-- zip_code += `<p>`+ value + `</p>`;--}}
  96. {{-- });--}}
  97. {{-- $("#code").html(zip_code);--}}
  98. {{-- }--}}
  99. {{-- })--}}
  100. {{-- var str = "您所查找的中国"+$('#provinces_id').children('option:selected')[0].innerText+$(this).children('option:selected')[0].innerText +"邮政编码为:";--}}
  101. {{-- $("#tips").text(str);--}}
  102. {{-- $(".display").css('display','block')--}}
  103. {{-- console.log($(this).children('option:selected')[0].innerText)--}}
  104. {{-- });--}}
  105. {{-- console.log($(this));--}}
  106. {{-- function changePro(e) {--}}
  107. {{-- console.log(e)--}}
  108. {{-- }--}}
  109. </script>
  110. <script type="text/javascript">
  111. $('.diy-notice').select2();
  112. </script>
  113. @endsection