更新一下获取热门书签的问题
This commit is contained in:
parent
3d39cf95c4
commit
2a3fad3dcf
|
|
@ -767,11 +767,11 @@ db.getHotBookmarksSearch = function(params) {
|
||||||
if (params.dateCreate) {
|
if (params.dateCreate) {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
d.setDate(d.getDate() - parseInt(params.dateCreate));
|
d.setDate(d.getDate() - parseInt(params.dateCreate));
|
||||||
sql += " AND `created_at` >= '" + d.getTime() + "'"
|
sql += " AND `date` >= '" + d.format("yyyyMMdd") + "'"
|
||||||
} else if (params.dateCreateBegin && params.dateCreateEnd) {
|
} else if (params.dateCreateBegin && params.dateCreateEnd) {
|
||||||
var dateCreateBegin = new Date(params.dateCreateBegin + "T00:00:00");
|
var dateCreateBegin = new Date(params.dateCreateBegin).format("yyyyMMdd");
|
||||||
var dateCreateEnd = new Date(params.dateCreateEnd + "T23:59:59");
|
var dateCreateEnd = new Date(params.dateCreateEnd).format("yyyyMMdd");
|
||||||
sql += " AND `created_at` >= '" + dateCreateBegin.getTime() + "' AND `created_at` <= '" + dateCreateEnd.getTime() + "' "
|
sql += " AND `date` >= '" + dateCreateBegin + "' AND `date` <= '" + dateCreateEnd + "' "
|
||||||
}
|
}
|
||||||
if (params.dateClick) {
|
if (params.dateClick) {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,9 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo
|
||||||
pubSubService.publish('TagCtr.showBookmarkInfo', bookmark);
|
pubSubService.publish('TagCtr.showBookmarkInfo', bookmark);
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.loadCardData = function() {
|
$scope.loadHotBookmarks = function() {
|
||||||
if (!$scope.loadBusy && !$scope.random) {
|
if (!$scope.loadBusy && !$scope.random) {
|
||||||
console.log('loadCardData.........')
|
console.log('begin loadHotBookmarks.........')
|
||||||
var menusScope = $('div[ng-controller="menuCtr"]').scope();
|
var menusScope = $('div[ng-controller="menuCtr"]').scope();
|
||||||
var login = (menusScope && menusScope.login) || false;
|
var login = (menusScope && menusScope.login) || false;
|
||||||
if (login) {
|
if (login) {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,22 @@ function date(date, settings) {
|
||||||
return year + '-' + month + '-' + day;
|
return year + '-' + month + '-' + day;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Date.prototype.format = function(fmt) { //author: meizz
|
||||||
|
var o = {
|
||||||
|
"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+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||||
|
for (var k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||||
|
return fmt;
|
||||||
|
}
|
||||||
|
|
||||||
app.directive('jsDataCreateInit', function($compile) {
|
app.directive('jsDataCreateInit', function($compile) {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<div class="ui segment js-hot-card" style="min-height:150px;">
|
<!-- 高度至少要设置1000,元素少时才能触发滚动条事件 -->
|
||||||
<div class="ui five stackable cards" infinite-scroll='loadCardData()' infinite-scroll-immediate-check="false">
|
<div class="ui segment js-hot-card" style="min-height:1000px;">
|
||||||
|
<div class="ui five stackable cards" infinite-scroll='loadHotBookmarks()' infinite-scroll-immediate-check="false">
|
||||||
<div class="card" ng-repeat="bookmark in bookmarks">
|
<div class="card" ng-repeat="bookmark in bookmarks">
|
||||||
<div class="content" style="max-height:70px;cursor:pointer" ng-click="jumpToUrl(bookmark.url)">
|
<div class="content" style="max-height:70px;cursor:pointer" ng-click="jumpToUrl(bookmark.url)">
|
||||||
<div class="description bookmarkTitle" title="{{bookmark.title}}">
|
<div class="description bookmarkTitle" title="{{bookmark.title}}">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue