...
|
...
|
@@ -653,6 +653,30 @@ define('yohood', function(require, exports) { |
|
|
|
|
|
//详情页资讯
|
|
|
exports.detailNews = function(id) {
|
|
|
//截取字符串
|
|
|
function cutString(str, len) {
|
|
|
//length属性读出来的汉字长度为1
|
|
|
if(str.length*2 <= len) {
|
|
|
return str;
|
|
|
}
|
|
|
var strlen = 0;
|
|
|
var s = "";
|
|
|
for(var i = 0;i < str.length; i++) {
|
|
|
s = s + str.charAt(i);
|
|
|
if (str.charCodeAt(i) > 128) {
|
|
|
strlen = strlen + 2;
|
|
|
if(strlen >= len){
|
|
|
return s.substring(0,s.length-1) + "...";
|
|
|
}
|
|
|
} else {
|
|
|
strlen = strlen + 1;
|
|
|
if(strlen >= len){
|
|
|
return s.substring(0,s.length-2) + "...";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return s;
|
|
|
}
|
|
|
var recom = '';
|
|
|
var hotVideo = '';
|
|
|
var lastNews = '';
|
...
|
...
|
@@ -664,7 +688,7 @@ define('yohood', function(require, exports) { |
|
|
}
|
|
|
var d = getLocalTime(create_time);
|
|
|
var type='<span class="item-time"><?php $en = array("01"=>"January","02"=>"February","03"=>"March","04"=>"April","05"=>"May","06"=>"June","07"=>"July","08"=>"August","09"=>"September","10"=>"October","11"=>"November","12"=>"December");$m=date("m", '+create_time+');echo $en[$m]?> <?php ECHO $m=date("d.Y", '+create_time+')?></span>';
|
|
|
var title = $('<p>' + title + '</p>').text();
|
|
|
var title = $('<p>' + cutString(title,60) + '</p>').text();
|
|
|
var html = '<div class="layout-item clearfix">' +
|
|
|
'<div class="image-box">' +
|
|
|
'<a href="' + url + '" target="_blank" title="' + title + '">' +
|
...
|
...
|
|