//璇锋眰鐨勬帴鍙 var protocol = location.protocol === 'http:' ? 'http:' : 'https:'; var PUBLICHOST = protocol + '//yuyoadmin.yyxxgame.com'; var PUBLICALONEID = null; var PUBLICIMGURL = protocol + '//yuyoadmin.yyxxgame.com/upload/'; var PUBLICPATH = window.document.location.href; var PUBLICVERSION = '20231130'; var PUBLICNAME = { 'index':'棣栭〉', 'introduction':'浜嗚В鍏冩父', 'product':'鍏冩父浜у搧', 'companydaily':'浜哄湪鍏冩父', 'contact':'鑱旂郴鎴戜滑' }; //璇锋眰鐨勭粺涓€鍏ュ彛 function publicApiFn(type, url, datas, async, callback){ if (!datas['game_id']) datas['game_id'] = PUBLICALONEID; $.ajax({ url: PUBLICHOST +url, type: type, async: async, data: datas, dataType: "jsonp", jsonp: "callback", success: function (res) { callback && callback(res); }, error:function(data){ toastr.error("鎿嶄綔澶辫触锛?); } }); }; /* * 鎻愮ず閰嶇疆 */ toastr.options = { "closeButton": false, "debug": false, "positionClass": "toast-top-center", "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "2000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" }; /* * 鏈湴缂撳瓨鐨勬柟娉 */ var proStorage = { save:function(key,value){ localStorage.setItem(key,JSON.stringify(value)); }, fetch:function(key){ var res = JSON.parse(localStorage.getItem(key)); return res != null ? res : [] // return JSON.parse(localStorage.getItem(key)) || []; }, remove:function(key){ localStorage.removeItem(key); } }; //缃戠珯榛戠櫧 (function(){ var d = new Date(); var year = d.getFullYear(); var dateRange = [year+'/04/03 17:00:00', year+'/04/04 23:59:59']; if(d.getTime() >= new Date(dateRange[0]).getTime() && d.getTime() <= new Date(dateRange[1]).getTime()) { var oHtml = document.getElementsByTagName('html')[0]; oHtml.className = 'gray-html'; }; })(); //鑾峰彇缃戠珯閰嶇疆淇℃伅 function PUBLICINITCOMMON(callback){ publicApiFn('post', '/user/common/info', {'game_id':'all'}, false, function(res){ if (res.code === 1) { PUBLICALONEID = setPublicAloneId(res.data); callback && callback(res); }else { toastr.warning(res.msg); }; }); }; //璁剧疆缃戠珯閰嶇疆淇℃伅 function setPublicAloneId(data){ try { // var href = ['http://www.','http://','https://www.','https://']; data.forEach(function(item){ if (PUBLICPATH.indexOf(item.stie_url) !== -1) { throw item.id; }; }); throw ''; }catch(err) { return err !== '' ? err : 1; } }; //璁剧疆澶撮儴 function setNavHtmlFun(){ var headHtml = ''; var footHtml = ''; publicApiFn('post', '/user/common/site_menu_sion', {}, false, function(res){ if (res.code === 1) { headHtml += ''; $('#header .header-nav').html(headHtml); $('#header .header-con .header-nav .first-menu li').hover(function(){ $(this).find('.menu-child').css('display','block'); },function(){ $(this).find('.menu-child').css('display','none'); }); footHtml += ''; $('#footer .footer-nav').html(footHtml); $('#header .header-nav a.article-click').click(function(){ jumpArticle($(this)); }); $('#footer .footer-nav .footer-box a.article-click').click(function(){ jumpArticle($(this)); }); }else { toastr.warning(res.msg); }; }); }; function jumpArticle(obj){ var pname = obj.parents('.menu-child'); var prevAllname = ''; if (pname.html()) { prevAllname = pname.prevAll('a').attr('data-name'); }; var name = obj.attr('data-name'); var id = obj.attr('data-id'); var template = obj.attr('data-template'); if (template && template !== '') { location.href = './article.html?id='+id+'&name='+template+'&url=/user/common/additional_content&place='+(prevAllname !== '' ? prevAllname + ',' + name : name); }else { window.open('./article.html?id='+id+'&name='+TEMPLATE_NAME+'&url=/user/common/additional_content&place='+name); }; }; //璁剧疆灏鹃儴 function setFooterHtmlFun(){ publicApiFn('post', '/user/common/info', {}, false, function(res){ if (res.code === 1) { $("#header .header-con #logo").html(''+res.data.game_title+''); res.data.legal_affairs_info += '
'; $("#footer .footer-con .footer-box").html(res.data.legal_affairs_info); if (TEMPLATE_NAME !== 'product') { $('.Wen_network_url').remove(); }; if ($('#business_temp')) { var businessHtml = '
'+ '

'+ 'BUSINESS COOPERATION
'+ '鍟嗗姟鍚堜綔'+ '

'+ '
'+ '
'+ '

鑱旂郴浜猴細'+res.data.business_people+'

'+ // '

'+ '

鍚堜綔閭锛?+res.data.business_postal+'

'+ '
'+ '
'+ '

鍚堜綔鐢佃瘽锛?+res.data.business_phone+'

'+ // '

鍚堜綔QQ锛?+res.data.business_bsi_qq+'

'+ '

鑱旂郴鍦板潃锛?+res.data.business_address+'

'+ '
'+ '
'+ '
'+ '
'; $('#business_temp').html(businessHtml); }; // $('head').prepend(res.data.retrieve_content); }else { toastr.warning(res.msg); }; }); }; // http://api.map.baidu.com/marker?location=23.143973,113.347038&title=鎼滅储鐨勪綅缃?content=榫欐辰鍟嗗姟澶у帵&output=html&src=webapp.baidu.openAPIdemo // 113.347038,23.143973 // http://api.map.baidu.com/place/search?query=榫欐辰鍟嗗姟澶у帵&location=23.143973,113.347038&radius=1000®ion=骞垮窞&output=html&src=webapp.baidu.openAPIdemo