You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
613 lines
22 KiB
613 lines
22 KiB
//门户代理配置 //测试环境
|
|
/* 交易所接口 25673*/
|
|
// var AgencyAddress = "http://localhost:8081/AgencyAddress/";
|
|
// var AgencyAddress = "http://58.30.231.137:8022/AgencyAddress/";
|
|
|
|
/**统一网管*/
|
|
// var api = "http://localhost:8081/dev-api/";
|
|
// var api = "http://58.30.231.137:8022/dev-api/";
|
|
|
|
/**交易结算访问量*/
|
|
// var insertClicka = "http://localhost:8081/insertClicka/";
|
|
// var insertClicka = "http://58.30.231.137:8022/insertClicka/";
|
|
|
|
/**认证缴费*/
|
|
// var Paymentlist = "http://localhost:8081/Paymentlist/";
|
|
// var Paymentlist = "http://58.30.231.137:8022/Paymentlist/";
|
|
|
|
//认证缴费 第三方支付
|
|
// var PayCallBack = "http://localhost:8081/PayCallBack/";
|
|
// var PayCallBack = "http://58.30.231.137:8022/PayCallBack/";
|
|
|
|
// var pathURL = "http://58.30.231.137:51317/dist/api/v2/fluid/preview?url=";
|
|
|
|
|
|
/* 交易所接口 25673*/ //正式环境
|
|
var AgencyAddress = "http://10.24.4.14:80/AgencyAddress/";
|
|
/**统一网管*/
|
|
var api = "http://10.24.4.14:80/slb/";
|
|
|
|
var pathURL = "http://10.24.4.14:51317/dist/api/v2/fluid/preview?url=";
|
|
|
|
var pay = "http://10.24.4.14/slb/";
|
|
|
|
/**认证缴费*/
|
|
var Paymentlist = "http://10.24.4.14/Paymentlist/";
|
|
|
|
//认证缴费 第三方支付
|
|
var PayCallBack = "http://10.24.4.14/PayCallBack/";
|
|
|
|
/*
|
|
*终端cookie缓存,键值对key=value;如果key的名称相同则会覆盖上一个值
|
|
*新增:cookieHandler.set("key1",value);
|
|
*获取:cookieHandler.get("key1",defaultValue);
|
|
*删除:cookieHandler.del("key1");
|
|
*/
|
|
var cookieHandler = {
|
|
path: "/",
|
|
get: function (name) {
|
|
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
|
|
if (arr != null) return unescape(arr[2]);
|
|
return null;
|
|
},
|
|
set: function (name, value, day) {
|
|
day = day == undefined ? 30 : day;
|
|
var str = name + '=' + value + '; ';
|
|
if (day) {
|
|
var date = new Date();
|
|
date.setTime(date.getTime() + day * 24 * 3600 * 1000);
|
|
str += 'expires=' + date.toGMTString() + '; ';
|
|
}
|
|
str += "path=" + this.path;
|
|
document.cookie = str;
|
|
},
|
|
del: function (name) {
|
|
this.set(name, null, -1);
|
|
}
|
|
};
|
|
|
|
let goods_image_url = "";
|
|
|
|
let reg = RegExp(/data:image\/.*;base64,/);
|
|
//获取封面图地址
|
|
function good_img(data) {
|
|
let myPix = new Array("../images/180-180.jpg", "../images/180-180-2.jpg", "../images/180-180-3.jpg",
|
|
"../images/180-180-3.jpg");
|
|
let randomNum = Math.floor((Math.random() * myPix.length));
|
|
if (data) {
|
|
if (reg.test(data)) { //判断图片数据是base64吗
|
|
return '<img class="img_url" src=' + data + ' alt="暂无图片">'
|
|
} else {
|
|
return '<img class="img_url" src=' + pathURL + encodeURIComponent(data) + ' alt="暂无图片">'
|
|
}
|
|
} else {
|
|
goods_image_url = myPix[randomNum]
|
|
return '<img class="img_url" src=' + myPix[randomNum] + ' alt="暂无图片">'
|
|
}
|
|
}
|
|
//获取背景图地址
|
|
function background_img(data) {
|
|
let myPix = new Array("../images/180-180.jpg", "../images/180-180-2.jpg", "../images/180-180-3.jpg",
|
|
"../images/180-180-3.jpg");
|
|
let randomNum = Math.floor((Math.random() * myPix.length));
|
|
if (data) {
|
|
if (reg.test(data)) { //判断图片数据是base64吗
|
|
return data
|
|
} else {
|
|
return pathURL + encodeURIComponent(data)
|
|
}
|
|
} else {
|
|
goods_image_url = myPix[randomNum]
|
|
return myPix[randomNum]
|
|
}
|
|
}
|
|
/*
|
|
手机号验证
|
|
*/
|
|
function checkMobile(idName, mobile, data) {
|
|
// idName 验证提示信息 mobile输入的值
|
|
if (mobile == "") {
|
|
data.css("border", "1px solid #f56c6c")
|
|
$(idName).text('手机号不能为空');
|
|
return false;
|
|
} else if (!/^1[3456789]\d{9}$/.test(mobile)) {
|
|
data.css("border", "1px solid #f56c6c")
|
|
$(idName).text('手机号格式不对');
|
|
return false;
|
|
} else {
|
|
data.css("border", "1px solid #d7d7d7")
|
|
$(idName).text('');
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function check(idName, mobile, data, val) {
|
|
// idName 验证提示信息 mobile输入的值
|
|
if (mobile == "") {
|
|
data.css("border", "1px solid #f56c6c")
|
|
$(idName).text(val);
|
|
return false;
|
|
} else {
|
|
data.css("border", "1px solid #d7d7d7")
|
|
$(idName).text('');
|
|
return true;
|
|
}
|
|
}
|
|
|
|
//过滤页面
|
|
function filter_html(data) {
|
|
if (data == "Home.html") {
|
|
data = "首页"
|
|
} else if (data == "PublicData.html") {
|
|
data = "公共数据专区"
|
|
} else if (data == "PublicDetails.html") {
|
|
data = "公共数据专区标的详情"
|
|
} else if (data == "collectionDetails.html") {
|
|
data = "公共数据专区集详情"
|
|
} else if (data == "Supermarketpage.html") {
|
|
data = "数据超市"
|
|
} else if (data == "SuperMarketList.html") {
|
|
data = "数据超市标的列表"
|
|
} else if (data == "superDetails.html") {
|
|
data = "数据超市标的详情"
|
|
} else if (data == "tasetDetails.html") {
|
|
data = "数据超市集详情"
|
|
} else if (data == "SinGuideList.html") {
|
|
data = "业务指南"
|
|
} else if (data == "SinGuideDetails.html") {
|
|
data = "业务指南详情"
|
|
} else if (data == "InfoCenterList.html") {
|
|
data = "资讯中心"
|
|
} else if (data == "InforDetails.html") {
|
|
data = "资讯中心详情"
|
|
} else if (data == "contact.html") {
|
|
data = "联系我们"
|
|
} else if (data == "shopCart.html") {
|
|
data = "购物车"
|
|
} else if (data == "login.html") {
|
|
data = "登录"
|
|
} else if (data == "payment.html") {
|
|
data = "订单支付"
|
|
} else if (data == "Account.html") {
|
|
data = "账户管理"
|
|
} else if (data == "MyCetification.html") {
|
|
data = "我的认证"
|
|
} else if (data == "BuyOrder.html") {
|
|
data = "买入订单"
|
|
} else if (data == "ByOrder.html") {
|
|
data = "卖出订单"
|
|
} else if (data == "BillManage.html") {
|
|
data = "发票管理"
|
|
} else if (data == "MyClosing.html") {
|
|
data = "我的结算"
|
|
} else if (data == "MyMessage.html") {
|
|
data = "我的消息"
|
|
} else if (data == "Store_details.html") {
|
|
data = "店铺详情"
|
|
} else if (data == "fxiyunLogin.html") {
|
|
data = "伏羲云登录"
|
|
} else if (data == "PaymentOrder.html") {
|
|
data = "认证缴费支付"
|
|
} else if (data == "CerationPayment.html") {
|
|
data = "认证缴费订单"
|
|
}
|
|
return data
|
|
}
|
|
|
|
|
|
$("#close_userannun_x").bind("click", function () {
|
|
$('#my_annunciate').show();
|
|
});
|
|
// 初始化页面信息
|
|
$(document).ready(function () {
|
|
// if (sessionStorage.getItem("Annunciate") == null) {
|
|
// $("body").append(
|
|
// '<div class="modal fade" id="my_annunciate" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">' +
|
|
// '<div class="modal-dialog" role="document" style="width:1300px;">' +
|
|
// '<div class="modal-content">' +
|
|
// '<div class="modal-header">' +
|
|
// '<button type="button" class="close" id="close_userannun_x" data-dismiss="modal" aria-label="Close">' +
|
|
// '<span aria-hidden="true">×</span>' +
|
|
// '</button>' +
|
|
// '<h4 class="modal-title" id="myModalLabel">临时通告</h4>' +
|
|
// '</div>' +
|
|
// '<div class="modal-body trade_agreement" style="height:560px;overflow: auto;">' +
|
|
// '<h1 style="width: 1200px;color: red;letter-spacing: 4rem;text-align: center;margin: 30px auto 40px;">全国文化大数据交易中心</h1>' +
|
|
// '<p style="width: 1200px;height: 1px;background-color: red;margin: 30px auto;"></p>' +
|
|
// '<h2 style="width: 1200px;text-align: center; margin: 30px auto 40px;font-weight: normal;">关于全国文化大数据交易中心系统升级的公告</h2>' +
|
|
// '<p class="trade_p_no_indent" style="width: 1200px;margin: 0 auto;padding: 10px 0;"> 各进场机构、用户:</p>' +
|
|
// '<p class="trade_p" style="width: 1200px;margin: 0 auto;text-indent: 32px;padding: 10px 0;">全国文化大数据交易中心目前试运行中,基于系统进一步升级需要,全国文化大数据交易中心交易网站、互联网门户网站将进行系统升级。</p>' +
|
|
// '<p class="trade_p" style="width: 1200px;margin: 0 auto;text-indent: 32px;padding: 10px 0;">升级期间上述网站于2022年9月20日00:00-9月21日24:00无法使用,如有不便敬请谅解!</p>' +
|
|
// '<p class="trade_p" style="width: 1200px;margin: 0 auto;text-indent: 32px;padding: 10px 0;">如有意见建议,请及时向全国文化大数据交易中心反馈。联系电话:0755-8826 6899</p>' +
|
|
// '<p class="trade_p" style="width: 1200px;margin: 0 auto;text-indent: 32px;padding: 10px 0;">特此公告 </p>' +
|
|
// '<div style="width: 1200px;text-align: right;margin: 0 auto;">' +
|
|
// '<p>全国文化大数据交易中心 </p>' +
|
|
// '<p>2022年9月14日</p>' +
|
|
// '</div>' +
|
|
// '</div>' +
|
|
// '</div>' + '</div>' + '</div>');
|
|
// $('#my_annunciate').modal({
|
|
// //点击背景不关闭
|
|
// backdrop: "static",
|
|
// //触发键盘esc事件时不关闭
|
|
// keyboard: false
|
|
// });
|
|
// sessionStorage.setItem("Annunciate", "000000");
|
|
// }
|
|
|
|
getStorageTimeObj(); //浏览页面时间
|
|
if (new Date().getTime() < sessionStorage.getItem("timeObj")) {
|
|
let historyURL = document.referrer.split("?")[0].split("/");
|
|
if (document.referrer) {
|
|
let meanDetentionTime = new Date().getTime() - localStorage.getItem("start_time");
|
|
let date = {
|
|
meanDetentionTime: Math.round(meanDetentionTime / 1000), //平均停留时间
|
|
pageUrl: filter_html(historyURL[historyURL.length - 1]), //页面url
|
|
pageView: 1, //浏览量
|
|
uniqueVisitor: 1 //访客数
|
|
}
|
|
var regEn = /^[\u4e00-\u9fa5]/;
|
|
if (regEn.test(date.pageUrl)) {
|
|
Addbrowsing(date);
|
|
}
|
|
localStorage.removeItem("start_time");
|
|
}
|
|
localStorage.setItem("start_time", new Date().getTime());
|
|
}
|
|
//foreach兼容ie的方法
|
|
Array.prototype.myForEach = function myForEach(callback, context) {
|
|
context = context || window;
|
|
if (Array.prototype.forEach) {
|
|
// 调用forEach方法,不做任何处理
|
|
this.forEach(callback, context);
|
|
return;
|
|
}
|
|
}
|
|
$("#headLogo")[0].href = "../images/favicon.jpg";
|
|
$("#login a")[0].href = "./login.html?time=" + new Date().getTime();
|
|
$("#Logout a")[0].href = "./Home.html?time=" + new Date().getTime();
|
|
$("#personalCenter a")[0].href = "./Account.html?time=" + new Date().getTime();
|
|
$("#news a")[0].href = "./MyMessage.html?time=" + new Date().getTime();
|
|
// 购物车跳转
|
|
$(".cart").bind("click", function () {
|
|
$(location).prop('href', './shopCart.html?time=' + new Date().getTime());
|
|
});
|
|
if (cookieHandler.get("normal_login_token")) {
|
|
$("#login").hide();
|
|
} else {
|
|
$("#personalCenter").hide();
|
|
$("#Logout").hide();
|
|
$("#news").hide();
|
|
}
|
|
// 退出登录清空cookie信息
|
|
$("#Logout").bind("click", function () {
|
|
cookieHandler.del("isliCode")
|
|
cookieHandler.del("normal_login_token")
|
|
cookieHandler.del("accountId")
|
|
cookieHandler.del("cellPhone")
|
|
cookieHandler.del("userType")
|
|
});
|
|
// 获取业务logo
|
|
var ajaxDemo = new AJAX_OBJ(AgencyAddress + "logo/logoImag", onUrlSuccess, onUrlError);
|
|
ajaxDemo.getRequestData();
|
|
|
|
// 用户登录成功后获取用户未读消息条数
|
|
if (cookieHandler.get("accountId")) {
|
|
var ajaxDemoInfo = new AJAX_OBJ(api + "noti/v1/notification/messageNumber?accountId=" + cookieHandler
|
|
.get("accountId"), onUrlInfoSuccess, onUrlError);
|
|
ajaxDemoInfo.getRequestData();
|
|
}
|
|
|
|
$("#customer").click(function () {
|
|
$('#step_value1').val("")
|
|
$('#step_value1').css("border", "1px solid #d7d7d7")
|
|
$('#step_validate1').text("");
|
|
$('#step_value2').val("")
|
|
$('#step_value2').css("border", "1px solid #d7d7d7")
|
|
$('#step_validate2').text("");
|
|
$('#step_value3').val("")
|
|
$('#step_value3').css("border", "1px solid #d7d7d7")
|
|
$('#step_validate3').text("");
|
|
$('#step_value4').val("")
|
|
$('#step_value4').css("border", "1px solid #d7d7d7")
|
|
$('#step_validate4').text("");
|
|
$('#myModals').modal("show");
|
|
});
|
|
$("#submit").click(function () {
|
|
let step_value1 = $('#step_value1').val();
|
|
let step_validate1 = $('#step_validate1');
|
|
let validate_result1 = check(step_validate1, step_value1, $('#step_value1'), "姓名不能为空");
|
|
let step_value2 = $('#step_value2').val();
|
|
let step_validate2 = $('#step_validate2');
|
|
let validate_result2 = checkMobile(step_validate2, step_value2, $('#step_value2'));
|
|
let step_value3 = $('#step_value3').val();
|
|
let step_validate3 = $('#step_validate3');
|
|
let validate_result3 = check(step_validate3, step_value3, $('#step_value3'), "公司名称不能为空");
|
|
let step_value4 = $('#step_value4').val();
|
|
let step_validate4 = $('#step_validate4');
|
|
let validate_result4 = check(step_validate4, step_value4, $('#step_value4'), "留言不能为空");
|
|
if (validate_result1 && validate_result2 && validate_result3 && validate_result4) {
|
|
var data = JSON.stringify({
|
|
username: step_value1,
|
|
phone: step_value2,
|
|
company: step_value3,
|
|
leaveWords: step_value4
|
|
})
|
|
// 客户提交留言表单
|
|
var ajaxLeavingDemo = new AJAX_OBJ(AgencyAddress + "user/contact/save/data",
|
|
onUrlLeavingSuccess, onUrlError);
|
|
ajaxLeavingDemo.postRequestData(data);
|
|
}
|
|
})
|
|
})
|
|
|
|
function getStorageTimeObj() {
|
|
if (sessionStorage.getItem('timeObj') == null) {
|
|
//获取当天23:59:59点的时间戳
|
|
let timeObj = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
|
|
sessionStorage.setItem("timeObj", timeObj); //存储到本地缓存中
|
|
}
|
|
}
|
|
|
|
//成功
|
|
function onUrlSuccess(xmlHttp) {
|
|
var returnData = eval('(' + xmlHttp.responseText + ')');
|
|
if (returnData.resultCode == "00000000") {
|
|
/*首 页 logo(可能是文字也可能是图片)*/
|
|
if (returnData.data.logoImages.length > 0) {
|
|
// $('.titles-name').text(returnData.data.logoImages[0].logoName);
|
|
$('.titles-name').html('<img src="' + returnData.data.logoImages[0].logoImgName + '" alt=""><span>' +
|
|
returnData.data.logoImages[0].logoName + '</span>');
|
|
}
|
|
|
|
/* 导航栏菜单 */
|
|
let nav = "";
|
|
returnData.data.columnList.myForEach(function (item, index, arr) {
|
|
nav += '<div><a onclick="det_url()" href="' + item.columnLink + '?time=' + new Date().getTime() +
|
|
'">' + item
|
|
.columnName + '</a></div>';
|
|
})
|
|
$('.itembox').html(nav);
|
|
|
|
// 底部
|
|
if (returnData.data.bottomList.length > 0) {
|
|
$(".footerbox").html(returnData.data.bottomList[0].partFourName)
|
|
$(".top1").html(returnData.data.bottomList[0].partOneName)
|
|
$(".top2").html(returnData.data.bottomList[0].partTwoName)
|
|
$(".top3").html(returnData.data.bottomList[0].partThreeBase64)
|
|
}
|
|
let aaa = $(location).prop('href').split("?")[0].split("/")
|
|
aaa = aaa[aaa.length - 1]
|
|
if (aaa === "Home.html") {
|
|
$(".punct_box").css({
|
|
"width": (returnData.data.rotations.length * 80 + (returnData.data.rotations.length - 1) * 20) +
|
|
"px"
|
|
})
|
|
if (returnData.data.rotations.length > 1) {
|
|
/* 轮 播 图 */
|
|
let banners = '';
|
|
let punct = ''
|
|
returnData.data.rotations.myForEach(function (item, index, arr) {
|
|
if (item.url) {
|
|
banners += '<li class="item"><a href="' + item.url +
|
|
'"><img src="' + item.rotationUrl +
|
|
'" alt=""></a></li>';
|
|
} else {
|
|
banners += '<li class="item"><span><img src="' + item.rotationUrl +
|
|
'" alt=""></span></li>';
|
|
}
|
|
if (index === returnData.data.rotations.length - 1) {
|
|
punct += '<div class="punct_item"></div>'
|
|
} else {
|
|
punct += '<div class="punct_item" style="margin-right: 20px;"></div>'
|
|
}
|
|
})
|
|
// returnData.data.rotations.forEach((item, index) => {
|
|
// banners += '<li class="item"><a href="' + item.url + '"><img src="' + item.rotationUrl +
|
|
// '" alt=""></a></li>';
|
|
// if (index === returnData.data.rotations.length - 1) {
|
|
// punct += '<div class="punct_item"></div>'
|
|
// } else {
|
|
// punct += '<div class="punct_item" style="margin-right: 20px;"></div>'
|
|
// }
|
|
// })
|
|
banners += '<li class="item"><a href="' + returnData.data.rotations[0].url + '"><img src="' + returnData
|
|
.data.rotations[0].rotationUrl + '" alt=""></a></li>';
|
|
let width = (returnData.data.rotations.length + 1) * 100 + '%'
|
|
$(".banner-list").css({
|
|
"width": width
|
|
});
|
|
$('.banner-list').html(banners);
|
|
$('.punct_box').html(punct);
|
|
// 自动轮播
|
|
let lengths = returnData.data.rotations.length
|
|
let timer = null; //定时器返回值,主要用于关闭定时器
|
|
|
|
$(".punct_item").removeClass("punct_item3")
|
|
$(".punct_item")[0].className = "punct_item punct_item3"
|
|
|
|
function timer1(data) {
|
|
let iNow = data;
|
|
timer = setInterval(function () { //打开定时器
|
|
iNow += 1;
|
|
if (iNow === $(".punct_item").length) {
|
|
$(".punct_item").removeClass("punct_item3")
|
|
$(".punct_item")[0].className = "punct_item punct_item3"
|
|
} else {
|
|
$(".punct_item").removeClass("punct_item3")
|
|
$(".punct_item")[iNow].className = "punct_item punct_item3"
|
|
}
|
|
$(".banner-list").animate({
|
|
left: -(100 * iNow) + "%"
|
|
}, 2000, "swing", function () {
|
|
if (iNow > lengths - 1) {
|
|
iNow = 0;
|
|
$(".banner-list").css({
|
|
"left": "0"
|
|
});
|
|
}
|
|
})
|
|
}, 5000);
|
|
};
|
|
timer1(0)
|
|
$(".punct_item").bind("click", function (data) {
|
|
$(".punct_item").removeClass("punct_item3")
|
|
data.target.className = "punct_item punct_item3"
|
|
clearInterval(timer);
|
|
for (let i = 0; i < $(".punct_item").length; i++) {
|
|
if (data.target.className === $(".punct_item")[i].className) {
|
|
if (i) {
|
|
$(".banner-list").animate({
|
|
left: -(100 * i) + "%"
|
|
}, 2000)
|
|
timer1(i)
|
|
} else {
|
|
$(".banner-list").animate({
|
|
left: -(100 * $(".punct_item").length) + "%"
|
|
}, 2000, "swing", function () {
|
|
$(".banner-list").css({
|
|
"left": "0"
|
|
});
|
|
})
|
|
timer1(0)
|
|
}
|
|
}
|
|
}
|
|
});
|
|
// $(".punct_item").click((data) => {
|
|
// $(".punct_item").removeClass("punct_item3")
|
|
// data.target.className = "punct_item punct_item3"
|
|
// clearInterval(timer);
|
|
// for (let i = 0; i < $(".punct_item").length; i++) {
|
|
// if (data.target.className === $(".punct_item")[i].className) {
|
|
// if (i) {
|
|
// $(".banner-list").animate({
|
|
// left: -(100 * i) + "%"
|
|
// }, 2000)
|
|
// timer1(i)
|
|
// } else {
|
|
// $(".banner-list").animate({
|
|
// left: -(100 * $(".punct_item").length) + "%"
|
|
// }, 2000, "swing", function() {
|
|
// $(".banner-list").css({
|
|
// "left": "0"
|
|
// });
|
|
// })
|
|
// timer1(0)
|
|
// }
|
|
// }
|
|
// }
|
|
// })
|
|
} else {
|
|
$('.banner-list').html('<li class="item"><a href="' + returnData.data.rotations[0].url +
|
|
'"><img src="' + returnData.data.rotations[0].rotationUrl + '" alt=""></a></li>');
|
|
$('.punct_box').html('<div class="punct_item punct_item3"></div>');
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
// 失败
|
|
function onUrlError(xmlHttp) {
|
|
if (xmlHttp == 401) {
|
|
Dreamer.error("登录超时,请重新登录");
|
|
cookieHandler.del("isliCode")
|
|
cookieHandler.del("normal_login_token")
|
|
cookieHandler.del("accountId")
|
|
cookieHandler.del("cellPhone")
|
|
cookieHandler.del("userType")
|
|
setTimeout(function () {
|
|
window.location.href = 'login.html?time=' + new Date().getTime();
|
|
}, 1000);
|
|
} else {
|
|
Dreamer.error("服务异常");
|
|
}
|
|
}
|
|
// 用户登录成功后获取用户未读消息条数
|
|
function onUrlInfoSuccess(xmlHttp) {
|
|
var returnData = eval('(' + xmlHttp.responseText + ')');
|
|
if (returnData.resultCode == "00000000") {
|
|
if (returnData.data == 0) {
|
|
$("#news > a").text("消息");
|
|
} else {
|
|
$("#news > a").text("消息(" + returnData.data + ")");
|
|
}
|
|
}
|
|
}
|
|
|
|
function det_url() {
|
|
localStorage.removeItem("listNewNum");
|
|
localStorage.removeItem("listNum");
|
|
}
|
|
|
|
// 留言板
|
|
function onUrlLeavingSuccess(xmlHttp) {
|
|
var returnData = eval('(' + xmlHttp.responseText + ')');
|
|
if (returnData.resultCode === "00000000") {
|
|
if (returnData.data == true) {
|
|
Dreamer.success("提交成功");
|
|
$('#myModals').modal("hide");
|
|
} else {
|
|
Dreamer.error(res.resultMsg);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* 解析token获取信息
|
|
*/
|
|
function verifyToken(token) {
|
|
//通过split()方法将token转为字符串数组
|
|
var toeknArray = token.split(".");
|
|
//取 数组中的第二个字符进行解析
|
|
var userInfo = JSON.parse(decodeURIComponent(escape(window.atob(toeknArray[1].replace(/-/g, "+").replace(/_/g,
|
|
"/")))));
|
|
cookieHandler.set("isliCode", userInfo.isliCode);
|
|
|
|
}
|
|
|
|
function test(e) {
|
|
var value = e.target.value;
|
|
value = value.replace(/\D+/, "");
|
|
if (value.length > 0) {
|
|
if (value.length > 1 && value[0] == 0) {
|
|
e.target.value = value.substring(1, value.length);
|
|
return;
|
|
}
|
|
e.target.value = value;
|
|
} else {
|
|
e.target.value = 0;
|
|
};
|
|
}
|
|
|
|
//添加检索信息数据
|
|
function Addbrowsing(date) {
|
|
var ajaxinterfaceDemo = new AJAX_OBJ(AgencyAddress + "BrowseInfo/insertBrowseInfo", oninterfaceSuccess, onUrlError);
|
|
ajaxinterfaceDemo.postRequestData(JSON.stringify(date));
|
|
}
|
|
|
|
function oninterfaceSuccess(xmlHttp) {
|
|
var res = eval('(' + xmlHttp.responseText + ')');
|
|
}
|
|
|
|
// 时间过滤器---时间戳转时间格式
|
|
function dateTime(data) {
|
|
if (!data) {
|
|
return "";
|
|
} else {
|
|
let date = new Date(parseInt(data));
|
|
let y = date.getFullYear();
|
|
let MM = date.getMonth() + 1;
|
|
MM = MM < 10 ? "0" + MM : MM;
|
|
let d = date.getDate();
|
|
d = d < 10 ? "0" + d : d;
|
|
let h = date.getHours();
|
|
h = h < 10 ? "0" + h : h;
|
|
let m = date.getMinutes();
|
|
m = m < 10 ? "0" + m : m;
|
|
let s = date.getSeconds();
|
|
s = s < 10 ? "0" + s : s;
|
|
return y + "-" + MM + "-" + d + " " + h + ":" + m + ":" + s;
|
|
}
|
|
}
|
|
|