Browse Source

发现、文章浏览时间展示
资源图片显示

luyanan 7 years ago
parent
commit
9c93b62ca2
3 changed files with 14 additions and 7 deletions
  1. 6 1
      cmp-portal/js/public/common.js
  2. 7 5
      css/genindex.css
  3. 1 1
      js/common.js

+ 6 - 1
cmp-portal/js/public/common.js

@ -176,12 +176,17 @@ function autho() {
176 176
177 177
/*时间转换*/
178 178
function TimeTr(dealtime) {
179
	var myDate = new Date(); 
179 180
	var s = dealtime;
181
	var y = s.substr(0, 4);
180 182
	var m = s.substr(4, 2);
181 183
	var d = s.substr(6, 2);
182 184
	var h = s.substr(8, 2);
183 185
	var minute = s.substr(10, 2);
184
	var formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
186
	var formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "")+ "日 " + h + ":" + minute;
187
	if(y != myDate.getFullYear()){
188
		formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "")+ "日 " + h + ":" + minute;
189
	}
185 190
	return formatTime;
186 191
}
187 192
/*时间格式转换*/

+ 7 - 5
css/genindex.css

@ -464,20 +464,22 @@ ul.tagList>li .h2Font{color:#666}
464 464
.form-item .addexpertRe ul.addexpert>li .madiaInfo{padding-right:42px;}
465 465
.form-item .addexpertRe ul.addexpert>li .addbtn{position: absolute;right: 20px;background: #ff9900;top: 50%;margin-top: -14px;cursor: pointer;padding: 4px 10px;color: #fff;border-radius: 4px;}
466 466
/*资源图片展示*/
467
.Imagebox{width:360px;}
467
.Imagebox{width:362px;}
468 468
.Imagebox .tb-pic a{display:table-cell;text-align:center;vertical-align:middle;}
469 469
.Imagebox .tb-pic a img{vertical-align:middle;}
470 470
.Imagebox .tb-pic a{*display:block;*font-family:Arial;*line-height:1;}
471 471
.Imagebox .tb-thumb{margin:10px 0 0;overflow:hidden;}
472 472
.Imagebox .tb-thumb li{background:none repeat scroll 0 0 transparent;float:left;height:50px;margin:0 6px 0 0;overflow:hidden;}
473
.Imagebox .tb-s360, .tb-s360 a{height:270px;width:360px;}
474
.Imagebox .tb-s360, .tb-s360 img{max-height:270px;max-width:360px;}
475
.Imagebox .tb-s66, .tb-s66 a{height:50px;width:66px;}
473
.Imagebox .tb-s360 a{height:270px;width:360px;}
474
.Imagebox .tb-s360 img{max-height:270px;max-width:360px;}
475
476
.Imagebox .tb-s66 a{height:48px;width:66px;}
476 477
.Imagebox .tb-s66 img{max-height:46px;max-width:66px;}
477 478
.Imagebox .tb-booth{border:1px solid #E5E5E5;position:relative;z-index:1;}
478
.Imagebox .tb-thumb .tb-selected{border:4px solid #ff9900;}
479
.Imagebox .tb-thumb .tb-selected{border:3px solid #ff9900;}
479 480
.Imagebox .tb-thumb .tb-selected div{background-color:#FFFFFF;border:medium none;}
480 481
.Imagebox .tb-thumb .tb-selected .tb-s66 a,.Imagebox .tb-thumb .tb-selected .tb-s66{height:44px;width:58px;}
482
.Imagebox .tb-thumb .tb-selected .tb-s66 img{max-height:44px;max-width:58px;}
481 483
.Imagebox .tb-thumb li div{border:1px solid #E5E5E5;}
482 484
div.zoomDiv{z-index:999;position:absolute;top:0px;left:0px;width:200px;height:200px;background:#ffffff;border:1px solid #E5E5E5;display:none;text-align:center;overflow:hidden;}
483 485
div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") repeat scroll 0 0 transparent;cursor:move;z-index:1;}

+ 1 - 1
js/common.js

@ -523,7 +523,7 @@ function commenTime(startTime){
523 523
    }else if(date3 >= 3600000 && date3 < 86400000){
524 524
    	return hours + "小时前";
525 525
    }else if(date3 >= 86400000 && date3 < 172800000){
526
    	return "昨天 " + startTime.substring(10,12) + ":" +startTime.substring(12,14);
526
    	return "昨天 " + startTime.substring(8,10) + ":" +startTime.substring(10,12);
527 527
    	
528 528
    }else if(date3 >= 172800000 && date3 < 31536000000){
529 529
    	return startTime.substring(4,6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6,8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8,10) + ":" + startTime.substring(10,12);