134 lines
3.1 KiB
JavaScript
134 lines
3.1 KiB
JavaScript
// 地址
|
||
|
||
// var apiUrl = "http://journal.com/";
|
||
// var apiUrlTG = "http://www.tougao.com/";
|
||
// var apiUrlImg = "http://journal.com/";
|
||
|
||
|
||
var apiUrl = "/";
|
||
var apiUrlTG = "/";
|
||
var apiUrlImg = "/public/";
|
||
|
||
// var apiUrlImg = "http://journalapi.tmrjournals.com/public/";
|
||
|
||
|
||
var imgjourUrl = apiUrlImg + "journalicon/";
|
||
var imgtopicUrl = apiUrlImg + "journaltopic/";
|
||
var imgarticleUrl = apiUrlImg + "articleicon/";
|
||
var imgsystemUrl = apiUrlImg + "system/";
|
||
var imglineUrl = apiUrlImg + "journalline/";
|
||
var imgcfpUrl = apiUrlImg + "journalCfp/";
|
||
var imgFileUrl = apiUrlImg + "";
|
||
|
||
|
||
|
||
// 资源
|
||
// IMGdoURL = 'http://journalapi.tmrjournals.com/public/'
|
||
// IMGupURL = 'http://journal.com/'
|
||
|
||
|
||
// 获取地址栏信息
|
||
function getQueryString(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return unescape(r[2]);
|
||
return null;
|
||
}
|
||
|
||
|
||
localStorage.setItem("Journals_num",getQueryString('J_num'));
|
||
// localStorage.setItem("Journals_num",'1');
|
||
// 获取缓存期刊id
|
||
var Jour_num = localStorage.Journals_num;
|
||
|
||
//返回顶部
|
||
$.goup({
|
||
trigger: 100,
|
||
bottomOffset: 150,
|
||
locationOffset: 60,
|
||
titleAsText: true
|
||
});
|
||
|
||
|
||
|
||
|
||
// 基本信息
|
||
|
||
function lead_in(){
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Journal/getJournal',
|
||
data: {
|
||
"journal_id": Jour_num
|
||
},
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
|
||
// 基本信息
|
||
var arr_jour = result.data.journal;
|
||
localStorage.setItem("Journals_color",arr_jour.system_color);
|
||
localStorage.setItem("Journals_title",arr_jour.title);
|
||
localStorage.setItem("Journals_issn",arr_jour.issn);
|
||
localStorage.setItem("Journals_usx",arr_jour.usx);
|
||
|
||
} else {
|
||
// ShowDanger("请求失败!");
|
||
}
|
||
},
|
||
error: function () {
|
||
ShowDanger("error!");
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
//时间
|
||
var formatTimeToDate1 = function(time){
|
||
return new Date(time).format("yyyy");
|
||
};
|
||
|
||
var formatTimeToDate2 = function(time){
|
||
return new Date(time).format("dd/MM/yyyy");
|
||
};
|
||
|
||
var formatTimeToDate3 = function(time){
|
||
return new Date(time).format("yyyy-MM-dd hh:mm:ss");
|
||
};
|
||
var formatTimeToDate4 = function(time){
|
||
return new Date(time).format("yyyy-MM-dd");
|
||
};
|
||
|
||
Date.prototype.format = function(format) {
|
||
var date = {
|
||
"M+": this.getMonth() + 1,
|
||
"d+": this.getDate(),
|
||
"h+": this.getHours(),
|
||
"m+": this.getMinutes(),
|
||
"s+": this.getSeconds(),
|
||
"q+": Math.floor((this.getMonth() + 3) / 3),
|
||
"S+": this.getMilliseconds()
|
||
};
|
||
if (/(y+)/i.test(format)) {
|
||
format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||
}
|
||
for (var k in date) {
|
||
if (new RegExp("(" + k + ")").test(format)) {
|
||
format = format.replace(RegExp.$1, RegExp.$1.length == 1
|
||
? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
|
||
}
|
||
}
|
||
return format;
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|