锘?('.indexMoreProduct .block').hover(function () { $('.indexMoreProduct .block').find('.show').show() $('.indexMoreProduct .block').find('.hide').hide() $(this).find('.show').hide() $(this).find('.hide').show() }) $('.indexProblem .left .block').hover(function () { $('.indexProblem .left .block').removeClass('active') $(this).addClass('active') var id = $(this).data("id"); $('.indexProblem').find('.right').hide() $('.indexProblem').find('.right' + id).show() }) var projectpreurl = { host: 'https://ylstage.wsgjp.com/', cmpre: 'cm/', txweb: "tx_web/" } var thisurl = window.location.host; if (thisurl.indexOf(".199") > -1) { projectpreurl.host = 'http://gateway.yl.ca.com/'; } else if (thisurl == 'localhost:58920') { projectpreurl.host = 'http://gateway.yl.ca.com/'; } cmurl = function (url) { return projectpreurl.host + projectpreurl.cmpre + url; } txWebUrl = function (url) { return projectpreurl.host + projectpreurl.txweb + url; } var uuid = ''; yzmaclick = function () { uuid = generateUUID(); setCookie("uuid", uuid, 30); $("#yzma").attr("src", txWebUrl("verify?uuid=" + uuid)); } $(document).ready(function yzmaclick() { uuid = generateUUID(); setCookie("uuid", uuid, 30); $("#yzma").attr("src", txWebUrl("verify?uuid=" + uuid)); }) function generateUUID() { var d = new Date().getTime(); if (window.performance && typeof window.performance.now === "function") { d += performance.now(); //use high-precision timer if available } var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); }); return uuid; } $('.indexMoreClass .bigClass .div').click(function () { if ($(this).hasClass('active')) { $(this).removeClass('active') } else { $(this).addClass('active') } }) $('.indexMoreClass p').click(function () { if ($(this).hasClass('active')) { $(this).removeClass('active') } else { $(this).addClass('active') } }) var urlHref = window.location.href var ajaxPostUrl = 'https://yl.wsgjp.com/' if (urlHref.indexOf(".199") != -1) { ajaxPostUrl = "http://gateway.yl.ca.com/"; } else if (urlHref.indexOf("localhost") != -1) { ajaxPostUrl = "http://gateway.yl.ca.com/"; } else if (urlHref.indexOf("stage") != -1){ ajaxPostUrl = "https://ylstage.wsgjp.com/"; } $('.submitButton').click(function () { var length = $('.indexMoreClass .active b').length var arr = [] var listText='' if (length > 0) { for (var i = 0; i < length; i++) { arr.push($('.indexMoreClass .active b').eq(i).html()) } listText = arr.toString() + ',' } var userName = $(this).parents('.indexMoreClass').find('.userName').val() var phone = $(this).parents('.indexMoreClass').find('.phone').val() var validCode = $(this).parents('.indexMoreClass').find('.validCode').val() var demandDescribe = listText+$(this).parents('.indexMoreClass').find('.demandDescribe').val() var positionName = "SEM棣栭〉" var positionId ='88' if (phone == '' || phone == undefined || phone == null) { alert('璇疯緭鍏ユ墜鏈哄彿鐮?) return false } if (!(/^1[3456789]\d{9}$/.test(phone))) { alert('鎵嬫満鍙锋湁璇紝璇烽噸鏂拌緭鍏?) return false } if (validCode == '') { alert('璇疯緭鍏ュ浘褰㈢爜') return false } if (validCode.length > 10) { alert('鍥惧舰鐮佷笉姝g‘') return false } if (userName == '') { alert('璇疯緭鍏ュ叕鍙稿悕') return false } if (userName.length > 32) { alert('鍏徃鍚嶆渶澶氬彲杈撳叆32浣?) return false } if (demandDescribe) { if (demandDescribe.length > 500) { alert('闇€姹傛弿杩版渶澶氬彲杈撳叆500瀛?) return false } } var client = { userName: userName, phone: parseInt(phone), validCode: validCode, demandDescribe: demandDescribe, siteId:5, positionName: positionName, positionId: positionId, uuid: uuid }; addInfo(phone, userName) $.ajax({ type: "POST", url: ajaxPostUrl + "tx_web/api/tryuserinfo/SubInfo", async: false, data: JSON.stringify(client), contentType: 'application/json', success: function (data) { if (data.code == 0) { alert('鎻愪氦鎴愬姛锛佹垜浠皢灏藉揩涓烘偍鎻愪緵瑙e喅鏂规'); setTimeout(function () { window.location.reload(); }, 1000) } else { alert(data.message); } } }); function addInfo(phone,userName) { var utmS = GetQueryString('utm_s'); var keyWord = GetQueryString('keyword'); if (utmS == "360") { keyWord = GetQueryString('utm_term') } var currentReferer = document.referrer addAjax(utmS, currentReferer, keyWord, phone, userName) } }) //鍒ゆ柇灞忓箷澶у皬 var windowWidth = document.documentElement.clientWidth; var urlDetailTextVal = window.location.href; console.log(urlDetailTextVal) if (windowWidth < 640 && urlDetailTextVal.indexOf("ewmCodeVal=1") != -1) { $('.h5Default').show(); $('.pcDefault').hide(); $('.footer-wrap').hide(); $('.right-popups').hide(); $('#topHeader').hide(); h5AjaxSbumit('1'); } if (windowWidth >= 640) { $('.h5Default').hide(); $('.pcDefault').show(); $('.footer-wrap').show(); $('.right-popups').show(); $('#topHeader').show(); } function h5AjaxSbumit(type) { var uid = JSON.parse(window.localStorage.getItem('md_cuid')) || ''; var targetUrlVal = 'http://172.16.3.28:10001' if (location.host.indexOf('wsgjp') > -1) { targetUrlVal = 'https://collection.mygjp.com' } var params = { uid: uid, typeId: type || '2', reqUrl: window.location.href } $.ajax({ type: "POST", url: targetUrlVal + "/co/call/add", contentType: "application/json", data: JSON.stringify(params), success: function (result) { } }); }