|
@@ -37,6 +37,39 @@ function afterJyObjInit(){
|
|
|
redSpotOnMenu({{session "s_m_openid"}});
|
|
|
}
|
|
|
function initpage(){
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: '/jyapp/front/hasPushHistory?t='+new Date().getTime(),
|
|
|
+ data: {},
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ success: function(data){
|
|
|
+ success = data.success;
|
|
|
+ lasttime = data.thistime;
|
|
|
+ firstPage = data.data;
|
|
|
+ if(data.data.length>0){
|
|
|
+ a_visitedindex = data.data[0].a_visitedindex;
|
|
|
+ }
|
|
|
+ if(!success && !data.haskey){
|
|
|
+ if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
|
|
|
+ sessionStorage.removeItem("keysetindexToHistory");
|
|
|
+ }else{
|
|
|
+ history.pushState({},"","");
|
|
|
+ if(data.isInTSguide){
|
|
|
+ if(localStorage){
|
|
|
+ localStorage.removeItem("tsGuide_status");
|
|
|
+ }
|
|
|
+ window.location.href='/jyapp/tenderSubscribe/guide';
|
|
|
+ }else{
|
|
|
+ window.location.href='/jyapp/wxkeyset/keyset/index';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(xhr, type){
|
|
|
+ hasNoData();
|
|
|
+ }
|
|
|
+ });
|
|
|
new FastClick(document.body);
|
|
|
$("#gotosetpage").click(function(){
|
|
|
setSessionStorage();
|
|
@@ -86,7 +119,7 @@ function initpage(){
|
|
|
noMoreData(wxflag,1);
|
|
|
}
|
|
|
$(window).scrollTop(scrollTop);
|
|
|
- sessionStorage.removeItem("historypushDataCache");
|
|
|
+ // sessionStorage.removeItem("historypushDataCache");
|
|
|
sessionStorage.removeItem("historypushListCache");
|
|
|
sessionStorage.removeItem("historypushTableCache");
|
|
|
sessionStorage.removeItem("historypushLasttimeCache");
|
|
@@ -95,39 +128,39 @@ function initpage(){
|
|
|
sessionStorage.removeItem("historypushCount");
|
|
|
localStorage.removeItem("listortable"+{{.T._id}},"T");
|
|
|
}else{
|
|
|
- $.ajax({
|
|
|
- type: 'post',
|
|
|
- url: '/jyapp/front/hasPushHistory?t='+new Date().getTime(),
|
|
|
- data: {},
|
|
|
- async: false,
|
|
|
- dataType: 'json',
|
|
|
- success: function(data){
|
|
|
- success = data.success;
|
|
|
- lasttime = data.thistime;
|
|
|
- firstPage = data.data;
|
|
|
- if(data.data.length>0){
|
|
|
- a_visitedindex = data.data[0].a_visitedindex;
|
|
|
- }
|
|
|
- if(!success && !data.haskey){
|
|
|
- if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
|
|
|
- sessionStorage.removeItem("keysetindexToHistory");
|
|
|
- }else{
|
|
|
- history.pushState({},"","");
|
|
|
- if(data.isInTSguide){
|
|
|
- if(localStorage){
|
|
|
- localStorage.removeItem("tsGuide_status");
|
|
|
- }
|
|
|
- window.location.href='/jyapp/tenderSubscribe/guide';
|
|
|
- }else{
|
|
|
- window.location.href='/jyapp/wxkeyset/keyset/index';
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- error: function(xhr, type){
|
|
|
- hasNoData();
|
|
|
- }
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // type: 'post',
|
|
|
+ // url: '/jyapp/front/hasPushHistory?t='+new Date().getTime(),
|
|
|
+ // data: {},
|
|
|
+ // async: false,
|
|
|
+ // dataType: 'json',
|
|
|
+ // success: function(data){
|
|
|
+ // success = data.success;
|
|
|
+ // lasttime = data.thistime;
|
|
|
+ // firstPage = data.data;
|
|
|
+ // if(data.data.length>0){
|
|
|
+ // a_visitedindex = data.data[0].a_visitedindex;
|
|
|
+ // }
|
|
|
+ // if(!success && !data.haskey){
|
|
|
+ // if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
|
|
|
+ // sessionStorage.removeItem("keysetindexToHistory");
|
|
|
+ // }else{
|
|
|
+ // history.pushState({},"","");
|
|
|
+ // if(data.isInTSguide){
|
|
|
+ // if(localStorage){
|
|
|
+ // localStorage.removeItem("tsGuide_status");
|
|
|
+ // }
|
|
|
+ // window.location.href='/jyapp/tenderSubscribe/guide';
|
|
|
+ // }else{
|
|
|
+ // window.location.href='/jyapp/wxkeyset/keyset/index';
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error: function(xhr, type){
|
|
|
+ // hasNoData();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
if(!success){
|
|
|
hasNoData();
|
|
|
return;
|
|
@@ -338,9 +371,33 @@ function structureHtml(object){
|
|
|
return '<div class="restime time-diff">'+area+datatype+industryname+tdf+'</div>';
|
|
|
});
|
|
|
$(this).append('<div style="clear:both;"></div>');
|
|
|
+
|
|
|
+ var tableVisit = "";
|
|
|
+ // 已读未读
|
|
|
+ var $list = $(this).find(".bt").attr("eid");
|
|
|
+ if (typeof (a_visitedindex) != "undefined") {
|
|
|
+ var xh = $(this).find(".xh").text().replace(".", "");
|
|
|
+ // console.log(xh);
|
|
|
+ for (var i = 0; i < a_visitedindex.length; i++) {
|
|
|
+ if (xh == a_visitedindex[i]) {
|
|
|
+ tableVisit="visited";
|
|
|
+ $(this).find("a.bt").addClass("visited");
|
|
|
+ $(this).find(".xh").addClass("visited");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (typeof (a_visitedindex) != "undefined") {
|
|
|
+ for (var i = 0; i < a_visitedindex.length; i++) {
|
|
|
+ if ($list == a_visitedindex[i]) {
|
|
|
+ tableVisit="visited";
|
|
|
+ $(this).find("a.bt").addClass("visited");
|
|
|
+ $(this).find(".xh").addClass("visited");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//
|
|
|
- tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\',\''+words.join("_")+'\')">'+
|
|
|
- '<td>'+count+'</td>'
|
|
|
+ tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\',\''+words.join("_")+'\',$(this))" class="'+tableVisit+'">'+
|
|
|
+ '<td>'+count+'</td>'
|
|
|
if(typeof(info.projectname) != "undefined"&&info.projectname != ""){
|
|
|
var pn = info.projectname;
|
|
|
for(var n=0;n<words.length;n++){
|
|
@@ -416,28 +473,6 @@ function structureHtml(object){
|
|
|
var tabletime = formatDate(info.publishtime);
|
|
|
tablehtml +='<td>'+tabletime+'</td></tr>'
|
|
|
|
|
|
- // 已读未读
|
|
|
- // console.log(a_visitedindex);
|
|
|
- var $list = $(this).find(".bt").attr("eid");
|
|
|
- if (typeof (a_visitedindex) != "undefined") {
|
|
|
- var xh = $(this).find(".xh").text().replace(".", "");
|
|
|
- // console.log(xh);
|
|
|
- for (var i = 0; i < a_visitedindex.length; i++) {
|
|
|
- if (xh == a_visitedindex[i]) {
|
|
|
- $(this).find("a.bt").addClass("visited");
|
|
|
- $(this).find(".xh").addClass("visited");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (typeof (a_visitedindex) != "undefined") {
|
|
|
-
|
|
|
- for (var i = 0; i < a_visitedindex.length; i++) {
|
|
|
- if ($list == a_visitedindex[i]) {
|
|
|
- $(this).find("a.bt").addClass("visited");
|
|
|
- $(this).find(".xh").addClass("visited");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
listCache += content.prop("outerHTML");
|
|
|
tableCache += tablehtml;
|
|
@@ -473,7 +508,7 @@ function formatDate(date,sl) {
|
|
|
//
|
|
|
function appendList(content,tablehtml){
|
|
|
content.children(".tslist").on("click", function(event){
|
|
|
- setVisitedIndex($(this));
|
|
|
+ setVisitedIndex($(this),"");
|
|
|
var sds = $(this).attr("words");
|
|
|
var h = $(this).find("a.bt").attr("s");
|
|
|
var eid = $(this).find("a.bt").attr("eid");
|
|
@@ -485,10 +520,11 @@ function appendList(content,tablehtml){
|
|
|
$(".findnull").hide();
|
|
|
$(".listcontent").show();
|
|
|
}
|
|
|
-function tablejump(eid,h,sds){
|
|
|
+function tablejump(eid,h,sds,t){
|
|
|
if(localStorage){
|
|
|
localStorage.setItem("listortable"+{{.T._id}},"T");
|
|
|
}
|
|
|
+ setVisitedIndex(t,eid);
|
|
|
beforeJump(eid,h,sds);
|
|
|
}
|
|
|
function beforeJump(eid,h,sds){
|
|
@@ -497,7 +533,7 @@ function beforeJump(eid,h,sds){
|
|
|
if(dataCache[i].a_visitedindex.length>0){
|
|
|
visitedArr = dataCache[i].a_visitedindex;
|
|
|
if(JSON.stringify(visitedArr).indexOf(eid)<0){
|
|
|
- dataCache[i].a_visitedindex = visitedArr.push(eid)
|
|
|
+ dataCache[i].a_visitedindex = visitedArr.push(eid);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -516,8 +552,9 @@ function setSessionStorage(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function setVisitedIndex(obj){
|
|
|
- if(obj.find("a.bt").hasClass("visit")){
|
|
|
+function setVisitedIndex(obj,eid){
|
|
|
+ // console.log(obj.hasClass("visited")+"--------");
|
|
|
+ if(obj.find("a.bt").hasClass("visit")||obj.hasClass("visited")){
|
|
|
return;
|
|
|
}
|
|
|
obj.find("a.bt").addClass("visited");
|
|
@@ -528,6 +565,10 @@ function setVisitedIndex(obj){
|
|
|
index = index.substring(0,index.length-1)
|
|
|
}
|
|
|
var vsid=obj.find("a.bt").attr("eid");
|
|
|
+ if (eid != ""){
|
|
|
+ obj.addClass("visited");
|
|
|
+ vsid = eid;
|
|
|
+ }
|
|
|
$.post("/jyapp/wxpush/bid/ajaxReq",{_id:_id,vsid:vsid,index:index});
|
|
|
}
|
|
|
</script>
|