123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <!DOCTYPE html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>鲸致生活-服务地址校验</title>
- <meta name="description" content="鲸致生活-服务地址校验">
- <meta name="viewport"
- content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <link
- rel="stylesheet"
- href="https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css"
- />
- <link rel="stylesheet" href="../auto/css/main.css">
- <link rel="stylesheet" href="../auto/css/normalize.css">
- <link rel="stylesheet" href="../auto/css/magnific-popup.css">
- <script src="../auto/js/jquery-1.7.2.min.js"></script>
- <script src="../auto/js/modernizr-2.6.2.min.js"></script>
- <script src="../auto/js/viewport.js"></script>
- <script src="../auto/js/config.js"></script>
- <script src="../auto/js/main.js"></script>
- <script src="../auto/js/jquery.magnific-popup.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js"></script>
- <style>
- .hidden {
- display: none;
- }
- .read{
- margin: auto;
- padding: 0 10px;
- margin-top: 50px;
- }
- .read .title{
- text-align: center;
- margin: 10px;
- }
- .read .header{
- font-weight: 600;
- }
- /*.read .content{
- font-size: 11px;
- }*/
- .line{
- position: relative;
- /* width: 100px; */
- top: -15px;
- text-align: center;
- background-color: #fff;
- margin: 0 auto;
- }
- .message{
- position: absolute;
- top: 30%;
- z-index: 999;
- color: #333;
- background-color: #09AFFF;
- text-align: center;
- margin: 0 10%;
- padding: 10px;
- border-radius: 15px;
- width: 80%;
- }
- p, pre {
- margin: 0.2em 0;
- }
- </style>
- </head>
- <body class="kb-bg">
- <div class="top">
- </div>
- <div class="steps">
- <div class="item">
- <div class="step color-back-blue">
- <div class="value">1</div>
- </div>
- <div class="bt color-blue">区域校验</div>
- </div>
- <hr class="hr"></hr>
- <div class="item">
- <div class="step color-back-gray">
- <div class="value">2</div>
- </div>
- <span class="bt color-gray">补贴申领</span>
- </div>
-
- <hr class="hr"></hr>
-
- <div class="item">
- <div class="step color-back-gray">
- <div class="value">3</div>
- </div>
- <span class="bt color-gray">补贴兑换</span>
- </div>
- </div>
- <div class="notice">
- <img src="../auto/img/icon/notice.png" class="notice-icon"/>
- <div style="font-size: 24px;" >尚未能覆盖所有远郊区域,需校验一下地址是否可提供服务</div>
- </div>
- <main>
- <div id="scan-integral">
- <form name="bindingtelPhoneForm" action="">
- <div class="input-from">
- <label class="label">选择城市:</label>
- <div style="display: inline-flex;">
- <img src="../auto/img/icon/address.png" style="width: 24px;height:30px;margin: auto;"/>
- <select id="city" class="select" name="city" style="width: 90%;margin-left:0;border: 0px;">
- <!-- <option disabled selected value=''>请选择所在城市</option> -->
- <option value="上海市" selected>上海市</option>
- <option value="北京市">北京市</option>
- <option value="深圳市">深圳市</option>
- <option value="南京市">南京市</option>
- <option value="苏州市">苏州市</option>
- </select>
- <span style="line-height: 70px;color: #A4ABB3;">></span>
- </div>
- </div>
- <hr style="border: none;height: 1px;border-top: 1px solid #EEEEEE;"></hr>
- <div class="input-from">
- <label class="label">详细地址:</label>
- <textarea class="input-arrow required" style="border:0px" rows="3" id="address" maxlength="30" placeholder="需8个字以上才能准确校验"></textarea>
- </div>
-
- <hr style="border: none;height: 1px;border-top: 1px solid #EEEEEE;"></hr>
- <div class="input-from">
- <button type="button" id="btn" class="btn" onclick="checkAddress()">立即校验</button>
- </div>
- </form>
- </div>
- <div class="footer">
- <!-- <img src="../auto/img/logo.png"/> -->
-
- <div class="img"></div>
- <fieldset class="marker">
- <legend>领先的互联网家政服务商</legend>
- </fieldset>
- </div>
- </main>
- <script type="text/javascript">
- $(function () {
- //messageCheckFailModal("您输入的地址系统无法识别<br/>请按输入框提示的格式输入",null,'上海浦东新区族中之路');
- $('#city').change(function () {
- var city = $("#city").val();
- if (city == '')
- $('#city').css("color", "#999");
- else
- $('#city').css("color", "#4c4c4c");
- })
- $('#city').change();
- });
- function checkAddress(){
- var city = $("#city").val();
- console.info(city)
- if (!city||typeof(city) == "undefined"||city == "") {
- vant.Dialog({
- message: '请选择所在城市' });
- // messageCheckModal("请选择所在城市","check-common",null,'确定');
- return;
- }
- var address = $("#address").val();
- if (address == "") {
- vant.Dialog({
- message: '请输入详细的地址' });
- // messageCheckModal("请输入详细的地址","check-common",null,'确定');
- return;
- }
- if ($.trim(address).length < 8) {
- vant.Dialog({
- message: '需8个字以上才能准确校验' });
- // messageCheckModal("请输入至少8位长度地址","check-common",null,'确定');
- return;
- }
- if(address.indexOf(city)<0)
- address=city+address;
-
- var paras={
- "addressDetail": address,
- "city": "",
- "county": "",
- "province": ""
- }
-
- let url=getBaseUrl()+"/wx/address/checkInputAddress";
- $.ajax({
- type: 'post',
- contentType: "application/json",
- dataType: "json",
- data:JSON.stringify(paras),
- url: url,
- cache: false,
- async: false,
- success: function (data) {
- if (data.errno == 0) {
- //confirmCancel("您所填写的服务地址在服务区域内,请点击“下一步”,输入您的<span style='color:red'>上汽乘用车员工登记时的手机号及工牌号</span>",goNext,goClose)
- vant.Dialog.confirm({ message: '您输入的地址在可服务区域内', cancelButtonText:'更换地址', confirmButtonText:'申领补贴'})
- .then(() => {
- // on confirm
- goNext();
- })
- .catch(() => {
- // on cancel
- });
- // messageCheckModal("您输入的地址在可服务区域内","check-success",goNext,'确定申领');
- }
- else{
- vant.Dialog.confirm({
- message: '您输入的地址尚未覆盖',
- cancelButtonText:'更换地址',
- confirmButtonText:'定制服务'
- })
- .then(() => {
- // on confirm
- //跳转到人工定制页面
- var city = $("#city").val();
- var address = $("#address").val();
- address=city+address;
- window.location.href='nocover.html?address='+address;
- })
- .catch(() => {
- // on cancel
- });
- // messageCheckFailModal("您输入的地址尚未覆盖",null,address);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- }
- });
- }
- function goNext(){
- let type=getQueryString('type');//0 119保洁 1 144品类
- if(type==null) type=0;
- window.location.href='coupon.html?type='+type;
- }
- function goClose(){
- $('.message').addClass('hidden');
- }
- //获取url参数
- function getQueryString(name) {
- var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
- var r = window.location.search.substr(1).match(reg);
- if (r != null) {
- return unescape(r[2]);
- }
- return null;
- }
-
-
- </script>
- </body>
- </html>
|