; } // Tab JS function setTab(name, cursel, n) { for (i = 1; i <= n; i++) { var menu = document.getElementById(name + i); var con = document.getElementById("con_" + name + "_" + i); menu.className = i == cursel ? "hover" : ""; con.style.display = i == cursel ? "block" : "none"; } } function changeverifycode() { $('#imgVerifyCodePic').attr("src", "/H5/Index/verifycode?r=" + comFn.guid() + ""); } function CheckMobile(str) { var re = /^1\d{10}$/ if (re.test(str) && str.length == 11) { return true; } else { return false; } } function getVeriCode() { var phone = $("#telphone").val(); var imgCode = $("#imgCode").val(); if (imgCode == "") { swal("错误", "请填写图形验证码", "error"); return false; } if (CheckMobile(phone)) { jQuery.ajax({ url: "/H5/IndexApi/getVeriCode?r=" + comFn.guid() + "", async: false, type: "post", data: { imgCode: imgCode, phone: phone }, dataType: 'json', success: function(data) { if (data.errCode == 0) { $("#code").val(data.verificationCode); $("#getMobileCode").css("display", "none"); $("#getMobileCodeNoActive").css("display", ""); $("#getMobileCodeNoActive").html("重新获取(60)"); $("#seconds").val("60"); $("#code").select(); window.setTimeout(getMobileCode, 1000); } else { swal("错误", data.errMsg, "error"); changeverifycode(); } }, error: function() { swal("错误", "请输入正确的手机号码", "error"); } }); } else { swal("错误", "请输入正确的手机号码", "error"); } } function showwxqrcode() { hidediv(); setTimeout(function() { $.get("/Home/Index/wxqrcode.html", function(data) { var dialog = art.dialog(); var html = "
" + $(data).find("#mailContentContainer").html() + "
"; dialog.title('欢迎使用'); dialog.content(html); dialog.lock(); }); }, "300"); } function postCar() { var $per = "0"; if ($per == "0") { showdiv(); } else { location.href = "/Home/Index/postlist.html"; } } function dologin() { var password = $("#password").val(); var phone = $("#phone").val(); var flag = true; if (phone == "") { // cAlert("手机号不能为空"); swal("手机号不能为空", "", "info"); flag = false; return false; } if (password == "") { // cAlert("密码不能为空"); swal("密码不能为空", "", "info"); flag = false; return false; } if (flag) { $.ajax({ url: "/H5/IndexApi/login?r=" + comFn.guid() + "", type: "post", async: false, data: { 'type': 1, 'phone': phone, 'password': password, 'osType':"pc" }, success: function(data) { if (data.errCode == "0") { var desc = ""; if (data.data.user_name == "") { desc = "请至恭喜发车服务号完善个人资料"; } // cAlert("成功"); swal("登录成功", desc, "success").then(function() { // document.location = "/Home/Index/postlist.html"; // window.open("/Home/Index/postlist.html", "_blank") location.href = location.href; }); } else { // cAlert("失败"); swal("登录失败", data.errMsg, "error"); } }, error: function(err) { swal("登录失败", "", "error"); } }); } } function dologin2() { var pass = true; if ($("#telphone").val() == "") { swal({ title: "请输入正确的手机号", text: "", type: "info" }); return false; } if (!CheckMobile($("#telphone").val())) { swal({ title: "请输入正确的手机号", text: "", type: "info" }); return false; } if ($("#code").val() == "") { swal({ title: "请输入短信验证码", text: "", type: "info" }); return false; } if ($("#imgCode").val() == "") { swal({ title: "请输入图形验证码", text: "", type: "info" }); return false; } if (!pass) { return false; } var postdata = $("#frm").serialize(); var action = "/H5/IndexApi/register?r=" + comFn.guid() + ""; $.ajax({ url: "/H5/IndexApi/register?r=" + comFn.guid() + "", type: "post", data: { phone: $("#telphone").val(), code: $("#code").val() }, dataType: 'json', error: function() { swal("错误", "请输入正确的手机号码", "error"); }, success: function(data) { if (data.errCode == 0) { var desc = ""; if (data.data.user_name == "") { desc = "请至恭喜发车服务号完善个人资料"; } // cAlert("成功"); swal("登录成功", desc, "success").then(function() { // document.location = "/Home/Index/postlist.html"; window.open("/Home/Index/postlist.html", "_blank") location.href = location.href; }); } else { swal("错误", data.errMsg, "error"); } } }); } $(function() { $("#btnSreach").click(function() { var keyword = $.trim($("#keyword").val()); if (keyword == "") { swal({ title: "提示", text: "请输入需要搜索的车型名称", type: "info" }); return false; } setCookie("pc_keyword", keyword, 100); document.location = "/Home/Index/carlist.html?keyword=" + keyword + ""; }); var pc_keyword = getCookie("pc_keyword"); if (pc_keyword != "") { $("#keyword").val(pc_keyword); } var $per = "0"; if ($per == "0") { $("#btnRegister").html("登录"); $("#btnRegister").click(function() { showdiv(); // showwxqrcode(); }); } else { $("#btnRegister").html("安全退出"); $("#btnRegister").click(function() { document.location = "/Home/Index/logout.html"; }); } }); function getMobileCode1() { var seconds = $("#seconds1").val(); seconds = parseInt(seconds) - 1; if (seconds > 0) { $("#seconds1").val(seconds) $("#getMobileCode1").css("display", "none"); $("#getMobileCodeNoActive1").css("display", ""); $("#getMobileCodeNoActive1").html("重新获取(" + seconds + ")"); window.setTimeout(getMobileCode1, 1000); } else { $("#getMobileCode1").css("display", ""); $("#getMobileCodeNoActive1").css("display", "none"); $("#getMobileCodeNoActive1").html("重新获取(99)"); $("#getMobileCode1").html("获取验证码"); } } function getVeriCode1() { var phone = $("#telphone1").val(); var imgCode = $("#imgCode1").val(); if (imgCode == "") { swal("错误", "请填写图形验证码", "error"); return false; } if (CheckMobile(phone)) { jQuery.ajax({ url: "/H5/IndexApi/getVeriCode_unimgcode?r=" + comFn.guid() + "", async: false, type: "post", data: { phone: phone, imgCode: imgCode }, dataType: 'json', success: function(data) { if (data.errCode == 0) { $("#code1").val(data.verificationCode); $("#getMobileCode1").css("display", "none"); $("#getMobileCodeNoActive1").css("display", ""); $("#getMobileCodeNoActive1").html("重新获取(60)"); $("#seconds1").val("60"); $("#code1").select(); window.setTimeout(getMobileCode1, 1000); } else { swal("错误", data.errMsg, "error"); changeverifycode(); } }, error: function() { swal("错误", "请输入正确的手机号码", "error"); } }); } else { swal("错误", "请输入正确的手机号码", "error"); } } function dologin3() { var pass = true; if ($("#telphone1").val() == "") { swal({ title: "请输入正确的手机号", text: "", type: "info" }); return false; } if (!CheckMobile($("#telphone1").val())) { swal({ title: "请输入正确的手机号", text: "", type: "info" }); return false; } if ($("#code1").val() == "") { swal({ title: "请输入短信验证码", text: "", type: "info" }); return false; } if ($("#password1").val() == "") { swal({ title: "请输入密码", text: "", type: "info" }); return false; } if ($("#repassword1").val() == "") { swal({ title: "请再次输入确认密码", text: "", type: "info" }); return false; } if ($("#password1").val() != $("#repassword1").val()) { swal({ title: "两次输入的密码不一致,请重新输入", text: "", type: "info" }); return false; } $.ajax({ url: "/H5/IndexApi/register?r=" + comFn.guid() + "", type: "post", data: { phone: $("#telphone1").val(), code: $("#code1").val(), password: $("#password1").val() }, dataType: 'json', error: function() { swal("错误", "请输入正确的手机号码", "error"); }, success: function(data) { if (data.errCode == 0) { var desc = ""; if (data.data.user_name == "") { desc = "请先完善个人资料"; } // cAlert("成功"); $(".d-close").click(); swal("注册成功", desc, "success").then(function() { // document.location = "/Home/Index/postlist.html"; if (data.data.user_name == "") { window.open("/Home/Index/userinfo.html", "_blank") } location.href = location.href; }); } else { swal("错误", data.errMsg, "error"); } } }); }
已选中条件 > 共0条记录
品牌:
规格:
型号:
0 到第 确定
微信
扫码