PageSourceSearch

https://www.kingmechpump.com/common/js/common_one.js

js kingmechpump.com collected 2026-10-07 13:08:47 UTC 7,282 bytes, 220 lines download raw bytes

1 
2function hideMsgPop(){$('.inquiry-pop-bd').fadeOut('fast')}
3function showMsgPop(){$('.inquiry-pop-bd').fadeIn('fast')}
4	if($('body .inquiry-form-wrap').length>0){
5		var webTop=$('body .inquiry-form-wrap').offset().top-80
6		$('.product-btn-wrap .email,.company_subscribe .button,.side_content .side_list .email').click(function(){
7			 $("html, body").animate({ scrollTop:webTop }, 1000);
8			 $(".ad_prompt").show().delay(3000).hide(300);
9			})
10		}else{
11// 		    $('.showquiry').click(function(){
12// 		    	$('.inquiry-pop-bd').fadeIn('fast')
13// 			})
14		}
15  
16 
17$('.stopPropagation').click(function(e) {e.stopPropagation();})
18 var ajaxurl = '/wp-admin/admin-ajax.php';
19   
20function SendForm(addForm)
21{   
22	
23    var Form = $(addForm).parent().parent().parent(); 
24    if(CheckPost(Form)) 
25    { 
26        var index = layer.load(1, {
27          shade: [0.1,'#fff'] 
28        });
29		$.post(ajaxurl, $(Form[0]).serialize(), function(response) {
30		   
31		   var res = JSON.parse(response); 
32		   switch(res.code){
33			   case 0: 
34					layer.msg('Information record failed', {
35                        icon: 2,
36                        time: 2000 
37                    });
38					break;
39				case 2: 
40					layer.msg('You have not submitted data', {
41                        icon: 2,
42                        time: 2000 
43                    });
44					break;
45				case 3: 
46					layer.msg('Email and phone cannot be empty at the same time.', {
47                        icon: 2,
48                        time: 2000 
49                    });
50					break;
51				case 4: 
52					layer.msg('The message cannot be empty.', {
53                        icon: 2,
54                        time: 2000
55                    });
56					break;
57				case 1: 
58					layer.closeAll('loading'); 
59					Form[0].reset();
60					hideMsgPop();
61					window.location.href = '/success.html'
62					break;
63				default: 
64					//layer.msg('Submitted successfully, customer service will contact you later.', {
65                    //   icon: 1,
66                    //    time: 2000 //2秒关闭(如果不配置,默认是3秒)
67                    //});
68					layer.closeAll('loading'); 
69					console.log(res.message);
70                    layer.msg('Network anomaly, please try again later', {
71                        icon: 2,
72                        time: 2000
73                    }); 
74					
75		   }
76		}); 
77    }
78}  
79function CheckPost(form) 
80{   
81   
82    var Fname = $(form[0].name);
83    var Femail = $(form[0].email);
84    var Fphone = $(form[0].phone);
85    var FMessage = $(form[0].message);  
86     console.log(Fname);
87	if (Fname.val() == "") 
88	{ 
89		 layer.msg('Name cannot be empty', {
90            icon: 2,
91            time: 2000
92        });
93		 Fname.focus();
94		 return false;
95	}
96	if (Femail.val() == "")
97	{ 
98		 layer.msg('The mailbox cannot be empty', {
99            icon: 2,
100            time: 2000 
101        });
102		 Femail.focus();
103		 return false;
104	}
105	/*else{ 
106         var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
107         isok= reg.test(Femail.val());
108           if(!isok) { 
109                layer.msg('The email format is incorrect, please reenter!', {
110                    icon: 2,
111                    time: 2000 
112                });
113                Femail.focus();
114                return false;
115            } 
116	}*/
117	if (Fphone.val() == "")
118	{ 
119		 layer.msg('Phone cannot be empty', {
120            icon: 2,
121            time: 2000 
122        });
123		 Fphone.focus();
124		 return false;
125	}
126	//else{
127	//	let phone = /^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))[0-9]{8}$/
128	//	let ring = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
129	//	if(phone.test(Fphone.val()) || ring.test(Fphone.val())){
130	//		
131	//	}else{
132	//		layer.msg('The phone format is incorrect, please re-enter!', {
133    //                icon: 2,
134     //               time: 2000 
135     //           });
136     //           Fphone.focus();
137     //           return false;
138	//	}
139          
140	//} 
141	if (FMessage.val() == "")
142	{ 
143		 layer.msg('FMessage cannot be empty', {
144            icon: 2,
145            time: 2000
146        });
147		 FMessage.focus();
148		 return false;
149	} 
150	return true;
151}
152
153
154
155 
156$(document).ready(function() {
157    //解决小语种表单不提交
158    if (!$('.ch_form').attr('action')) { $('.ch_form').attr('action','javascript:;') };
159    if (!$('.ch_forming').attr('action')) { $('.ch_forming').attr('action','javascript:;') };
160    $('.showquiry').click(function(){ 
161        showMsgPop()
162    }) 
163	if($('.hide_false')){$('.hide_false').remove();}
164  if ($('body #trp-floater-ls-language-list').length > 0 && $('.trp-floater-ls-current-language a').length < 1) {
165	 
166	   $('.trp-language-wrap').append("<div class='lang-more'>More Language</div>")
167    $('#trp-floater-ls-language-list .trp-language-wrap').appendTo('.change-language .change-language-cont')
168    if ($('.change-language .change-language-cont .trp-language-wrap a').length > 0) {
169      $('.change-language .change-language-cont .change-empty').hide()
170      $('.change-language .change-language-cont .trp-language-wrap a').each(function(index) {
171        if (index > 14) {
172          $(this).addClass('lang-item lang-item-hide')
173          $('.change-language-cont').find('.lang-more').fadeIn()
174        } else {
175          $('.change-language-cont').find('.lang-more').fadeOut()
176        }
177      })
178      if ($('.change-language-cont .lang-more').length > 0) {
179        $('.change-language-cont .lang-more').click(function() {
180          if ($(this).parents('.change-language-cont').find('.trp-language-wrap a.lang-item').hasClass('lang-item-hide')) {
181            $(this).parents('.change-language-cont').find('.trp-language-wrap a.lang-item').removeClass('lang-item-hide')
182            $(this).addClass('more-active').text('x')
183          } else {
184            $(this).parents('.change-language-cont').find('.trp-language-wrap a.lang-item').addClass('lang-item-hide')
185            $(this).removeClass('more-active').text('More Language')
186          }
187        })
188      }
189    } else {
190      $('.change-language .change-language-cont .change-empty').fadeIn()
191    }
192  }
193  $("#trp-floater-ls").hide(); 
194})
195//监控
196let isCooling = false; // 标记是否在冷却期
197// 初始化邮箱点击监听(事件委托方式)
198function setupEmailClickListener() {
199    // 监听整个文档的点击事件(事件委托)
200    document.addEventListener('click', function(event) {
201        // 获取被点击的元素
202        let target = event.target;
203
204        // 向上溯源,找到包含 mailto: 的 <a> 标签(处理图片/文字在<a>内部的情况)
205        while (target && (target.tagName).toLowerCase() !== 'a' && target !== document) {
206            target = target.parentElement;
207        }
208
209        // 判断是否是邮箱链接(href以mailto:开头)
210        if (target && (target.tagName).toLowerCase() === 'a' && target.href && target.href.startsWith('mailto:')) {
211            if (isCooling) return;
212            isCooling = true;
213            $.post('https://crm.cnmqh.com/api/website/addEmailClickLog', {url: window.location.href, email: target.href.replace('mailto:', '')}, function (res) {})
214            setTimeout(() => { isCooling = false; }, 3000);
215        }
216    });
217}
218
219// 页面加载完成后启动监听
220document.addEventListener('DOMContentLoaded', setupEmailClickListener);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.