check.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  5. <title>鲸致生活-服务地址校验</title>
  6. <meta name="description" content="鲸致生活-服务地址校验">
  7. <meta name="viewport"
  8. content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  9. <link
  10. rel="stylesheet"
  11. href="https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css"
  12. />
  13. <link rel="stylesheet" href="../auto/css/main.css">
  14. <link rel="stylesheet" href="../auto/css/normalize.css">
  15. <link rel="stylesheet" href="../auto/css/magnific-popup.css">
  16. <script src="../auto/js/jquery-1.7.2.min.js"></script>
  17. <script src="../auto/js/modernizr-2.6.2.min.js"></script>
  18. <script src="../auto/js/viewport.js"></script>
  19. <script src="../auto/js/config.js"></script>
  20. <script src="../auto/js/main.js"></script>
  21. <script src="../auto/js/jquery.magnific-popup.min.js"></script>
  22. <script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
  23. <script src="https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js"></script>
  24. <style>
  25. .hidden {
  26. display: none;
  27. }
  28. .read{
  29. margin: auto;
  30. padding: 0 10px;
  31. margin-top: 50px;
  32. }
  33. .read .title{
  34. text-align: center;
  35. margin: 10px;
  36. }
  37. .read .header{
  38. font-weight: 600;
  39. }
  40. /*.read .content{
  41. font-size: 11px;
  42. }*/
  43. .line{
  44. position: relative;
  45. /* width: 100px; */
  46. top: -15px;
  47. text-align: center;
  48. background-color: #fff;
  49. margin: 0 auto;
  50. }
  51. .message{
  52. position: absolute;
  53. top: 30%;
  54. z-index: 999;
  55. color: #333;
  56. background-color: #09AFFF;
  57. text-align: center;
  58. margin: 0 10%;
  59. padding: 10px;
  60. border-radius: 15px;
  61. width: 80%;
  62. }
  63. p, pre {
  64. margin: 0.2em 0;
  65. }
  66. </style>
  67. </head>
  68. <body class="kb-bg">
  69. <div class="top">
  70. </div>
  71. <div class="steps">
  72. <div class="item">
  73. <div class="step color-back-blue">
  74. <div class="value">1</div>
  75. </div>
  76. <div class="bt color-blue">区域校验</div>
  77. </div>
  78. <hr class="hr"></hr>
  79. <div class="item">
  80. <div class="step color-back-gray">
  81. <div class="value">2</div>
  82. </div>
  83. <span class="bt color-gray">补贴申领</span>
  84. </div>
  85. <hr class="hr"></hr>
  86. <div class="item">
  87. <div class="step color-back-gray">
  88. <div class="value">3</div>
  89. </div>
  90. <span class="bt color-gray">补贴兑换</span>
  91. </div>
  92. </div>
  93. <div class="notice">
  94. <img src="../auto/img/icon/notice.png" class="notice-icon"/>
  95. <div style="font-size: 24px;" >尚未能覆盖所有远郊区域,需校验一下地址是否可提供服务</div>
  96. </div>
  97. <main>
  98. <div id="scan-integral">
  99. <form name="bindingtelPhoneForm" action="">
  100. <div class="input-from">
  101. <label class="label">选择城市:</label>
  102. <div style="display: inline-flex;">
  103. <img src="../auto/img/icon/address.png" style="width: 24px;height:30px;margin: auto;"/>
  104. <select id="city" class="select" name="city" style="width: 90%;margin-left:0;border: 0px;">
  105. <!-- <option disabled selected value=''>请选择所在城市</option> -->
  106. <option value="上海市" selected>上海市</option>
  107. <option value="北京市">北京市</option>
  108. <option value="深圳市">深圳市</option>
  109. <option value="南京市">南京市</option>
  110. <option value="苏州市">苏州市</option>
  111. </select>
  112. <span style="line-height: 70px;color: #A4ABB3;">></span>
  113. </div>
  114. </div>
  115. <hr style="border: none;height: 1px;border-top: 1px solid #EEEEEE;"></hr>
  116. <div class="input-from">
  117. <label class="label">详细地址:</label>
  118. <textarea class="input-arrow required" style="border:0px" rows="3" id="address" maxlength="30" placeholder="需8个字以上才能准确校验"></textarea>
  119. </div>
  120. <hr style="border: none;height: 1px;border-top: 1px solid #EEEEEE;"></hr>
  121. <div class="input-from">
  122. <button type="button" id="btn" class="btn" onclick="checkAddress()">立即校验</button>
  123. </div>
  124. </form>
  125. </div>
  126. <div class="footer">
  127. <!-- <img src="../auto/img/logo.png"/> -->
  128. <div class="img"></div>
  129. <fieldset class="marker">
  130. <legend>领先的互联网家政服务商</legend>
  131. </fieldset>
  132. </div>
  133. </main>
  134. <script type="text/javascript">
  135. $(function () {
  136. //messageCheckFailModal("您输入的地址系统无法识别<br/>请按输入框提示的格式输入",null,'上海浦东新区族中之路');
  137. $('#city').change(function () {
  138. var city = $("#city").val();
  139. if (city == '')
  140. $('#city').css("color", "#999");
  141. else
  142. $('#city').css("color", "#4c4c4c");
  143. })
  144. $('#city').change();
  145. });
  146. function checkAddress(){
  147. var city = $("#city").val();
  148. console.info(city)
  149. if (!city||typeof(city) == "undefined"||city == "") {
  150. vant.Dialog({
  151. message: '请选择所在城市' });
  152. // messageCheckModal("请选择所在城市","check-common",null,'确定');
  153. return;
  154. }
  155. var address = $("#address").val();
  156. if (address == "") {
  157. vant.Dialog({
  158. message: '请输入详细的地址' });
  159. // messageCheckModal("请输入详细的地址","check-common",null,'确定');
  160. return;
  161. }
  162. if ($.trim(address).length < 8) {
  163. vant.Dialog({
  164. message: '需8个字以上才能准确校验' });
  165. // messageCheckModal("请输入至少8位长度地址","check-common",null,'确定');
  166. return;
  167. }
  168. if(address.indexOf(city)<0)
  169. address=city+address;
  170. var paras={
  171. "addressDetail": address,
  172. "city": "",
  173. "county": "",
  174. "province": ""
  175. }
  176. let url=getBaseUrl()+"/wx/address/checkInputAddress";
  177. $.ajax({
  178. type: 'post',
  179. contentType: "application/json",
  180. dataType: "json",
  181. data:JSON.stringify(paras),
  182. url: url,
  183. cache: false,
  184. async: false,
  185. success: function (data) {
  186. if (data.errno == 0) {
  187. //confirmCancel("您所填写的服务地址在服务区域内,请点击“下一步”,输入您的<span style='color:red'>上汽乘用车员工登记时的手机号及工牌号</span>",goNext,goClose)
  188. vant.Dialog.confirm({ message: '您输入的地址在可服务区域内', cancelButtonText:'更换地址', confirmButtonText:'申领补贴'})
  189. .then(() => {
  190. // on confirm
  191. goNext();
  192. })
  193. .catch(() => {
  194. // on cancel
  195. });
  196. // messageCheckModal("您输入的地址在可服务区域内","check-success",goNext,'确定申领');
  197. }
  198. else{
  199. vant.Dialog.confirm({
  200. message: '您输入的地址尚未覆盖',
  201. cancelButtonText:'更换地址',
  202. confirmButtonText:'定制服务'
  203. })
  204. .then(() => {
  205. // on confirm
  206. //跳转到人工定制页面
  207. var city = $("#city").val();
  208. var address = $("#address").val();
  209. address=city+address;
  210. window.location.href='nocover.html?address='+address;
  211. })
  212. .catch(() => {
  213. // on cancel
  214. });
  215. // messageCheckFailModal("您输入的地址尚未覆盖",null,address);
  216. }
  217. },
  218. error: function (XMLHttpRequest, textStatus, errorThrown) {
  219. }
  220. });
  221. }
  222. function goNext(){
  223. let type=getQueryString('type');//0 119保洁 1 144品类
  224. if(type==null) type=0;
  225. window.location.href='coupon.html?type='+type;
  226. }
  227. function goClose(){
  228. $('.message').addClass('hidden');
  229. }
  230. //获取url参数
  231. function getQueryString(name) {
  232. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  233. var r = window.location.search.substr(1).match(reg);
  234. if (r != null) {
  235. return unescape(r[2]);
  236. }
  237. return null;
  238. }
  239. </script>
  240. </body>
  241. </html>