Gucci 石英 Super Jumbo 大板台面批发 5041
");
$(“form”).submit(function(e) {
var form_item = $(this);
console.log(form_item)
/*emoji表情过滤*/
设 eRegStr =
/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig;
e.preventDefault();
var emailEl = $(this).find(“[name='email']”);
var messageEl = $(this).find(“[name='message']”);
var telEl = $(this).find(“[name='contact[tel]']”);
var emailValid = false,
messageValid = false,则
telValid = 假;
function formErrMsg(errText) {
$(“.error-msg”).html(errText);
$(“.error-msg”).stop().fadeIn(100);
setTimeout(() => {
$(“.error-msg”).stop().fadeOut(1000);
}, 3000);
}
如果 (emailEl.length) {
如果 (!/[-\w\.]+@[-\w\.]+(\.[-\w]+)+/.test(emailEl.val())) {
e.preventDefault();
formErrMsg(“请输入正确的电子邮件地址!”);
} else {
电子邮件有效 = true;
}
}
如果 (emailValid) {
如果 (messageEl.length) {
var 值 = messageEl.val().trim();
var 值 = messageEl.val();
if (!/\S{10,}/g.test(value.replace(/\s/g, “”))) {
e.preventDefault();
formErrMsg(“请输入超过 10 个字符的消息!”);
} else {
messageEl.val(value.replace(eRegStr, ''));
消息有效 = 真;
}
}
}
if (emailValid & & messageValid) {
var host = window.location.host;
如果 (telEl.length) {
var 值 = telEl.val().trim();
如果 (/^(zh\-cn\.)/.test(主机) ||/\.risingcn\./.test(host)) {
如果 (!/^1[3456789]\d{9}$/.test(value)) {
e.preventDefault();
formErrMsg(“请输入正确的手机号码!”);
}
} else {
if (value.length) {
/*
if ( isNaN(值) ) {
e.preventDefault();
formErrMsg(“请输入正确的手机号码”);
}
*/
} else {
/*
e.preventDefault();
formErrMsg(“请输入您的电话号码”);
*/
}
}
}
}
homeForm 参考捷胜首页底部的发送邮箱的表单 if (e.currentTarget.id == “dowmForm”) {
alert(“asd1f2s1df”);
e.preventDefault();
let flag = false;
let protocol = window.location.protocol;
let backpage = protocol + “//” + document.location.hostname + “/inquiryok?back=” + document.location.pathname;
if (emailValid & & messageValid) {
标志 = 真;
}
console.log(标志)
$.post(protocol + “//inquiry.digoodcms.com/api/save/goldtopstone”, $(this).serialize(), function(res, status) {
if (status == 'success') {
if(form_item.attr('dowm_url') != ''){
window.open(form_item.attr('dowm_url'), '_blank');
}
}else{
警报 (res.indexOf)
}
});
}
});
function getTimestamp() {
var d = new Date(),
Y = d.getFullYear(),
M = (d.getMonth() + 1) > 9 ?(d.getMonth() + 1) : '0' + (d.getMonth() + 1),
D = d.getDate() > 9 ?d.getDate() : '0' + d.getDate(),
h = d.getHours() > 9 ?d.getHours() : '0' + d.getHours(),
m = d.getMinutes() > 9 ?d.getMinutes() : '0' + d.getMinutes(),
s = d.getSeconds() > 9 ?d.getSeconds() : '0' + d.getSeconds();
var 时间戳 = '${Y}/${M}/${D} ${h}:${m}:${s}';
var rand = Math.random();
rand = rand.toString().substr(3);
返回时间戳 + ', version=' + rand;
}
如果 ($('.message-c0390d1870c55a52238446252a4ed26e').length) {
$('.message-c0390d1870c55a52238446252a4ed26e').val('from: ' + window.location.href + ', date: ' + getTimestamp());
}
});
indexAllDesign - js
$('.filter .categories li').click(function () {
$(this).siblings().removeClass('active');
$(this).addClass('主动');
})