完成备忘录的添加

This commit is contained in:
HelloWorld 2020-03-26 15:13:54 +08:00
parent 1d3b72ed2f
commit 8f8643deec
13 changed files with 1608 additions and 1576 deletions

View File

@ -12,6 +12,7 @@
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"fs-extra": "^9.0.0",
"node-readability": "^3.0.0",
"think-cache": "^1.0.0",
"think-cache-file": "^1.0.8",
"think-logger3": "^1.0.0",

View File

@ -30,7 +30,7 @@ exports.cache = {
exports.model = {
type: 'mysql',
common: {
logConnect: isDev,
logConnect: false,
logSql: isDev,
logger: msg => think.logger.info(msg)
},

View File

@ -1,6 +1,7 @@
const Base = require('./base.js');
const crypto = require('crypto');
const fs = require('fs-extra');
const read = require('node-readability');
function md5(str) {
return crypto.createHash('md5').update(str).digest('hex');
@ -84,8 +85,8 @@ module.exports = class extends Base {
if (param.bookmarkCount) {
tag.bookmarkCount = await this.model('bookmarks').where({ tagId: tag.id }).count();
}
if (param.notes) {
tag.bookmarkCount = await this.model('notes').where({ tagId: tag.id }).count();
if (param.noteCount) {
tag.noteCount = await this.model('notes').where({ tagId: tag.id }).count();
}
}
this.json({ code: 0, data: tags, msg: '' });
@ -104,6 +105,19 @@ module.exports = class extends Base {
}
}
// 获取书签
// @todo 如果是自己的任意获取,如果是别人的必须公开才能获取
async bookmarkAction() {
let id = this.get("id");
try {
let data = await this.model('bookmarks').where({ id }).find();
this.json({ code: 0, data });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
// 添加书签
async addBookmarkAction() {
let bookmark = this.post();
bookmark.userId = this.ctx.state.user.id;
@ -140,6 +154,69 @@ module.exports = class extends Base {
}
}
// 点击书签
async clickBookmarkAction() {
let id = this.post("id");
try {
let data = await this.model('bookmarks').where({
userId: this.ctx.state.user.id,
id
}).update({
clickCount: ['exp', 'clickCount+1'],
lastClick: ['exp', 'NOW()']
});
this.json({ code: 0, data });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
// 更新书签
async updateBookmarkAction() {
let bookmark = this.post();
try {
let data = await this.model('bookmarks').where({
userId: this.ctx.state.user.id,
id: bookmark.id
}).update(bookmark);
this.json({ code: 0, data });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
// 获取文章
async getArticleAction() {
let url = this.get("url");
async function readArticle(url) {
return new Promise(function (resolve, reject) {
read(url, (err, article, meta) => {
if (err) {
reject(err)
} else {
resolve({
title: article.title
});
article.close();
}
});
})
}
try {
let article = await readArticle(url);
this.json({
code: 0,
data: {
title: article.title
}
});
} catch (error) {
this.json({
code: 1,
msg: error.toString()
});
}
}
// 新增留言
async addAdviceAction() {
let advice = this.post();
@ -161,4 +238,53 @@ module.exports = class extends Base {
this.json({ code: 1, data: '', msg: error.toString() });
}
}
// 新增
async addNoteAction() {
let note = this.post();
note.userId = this.ctx.state.user.id;
try {
let data = await this.model("notes").add(note);
this.json({ code: 0, data, msg: `备忘添加成功` });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
// 更新备忘
async updateNoteAction() {
let note = this.post();
note.userId = this.ctx.state.user.id;
try {
let data = await this.model('bookmarks').where({
userId: this.ctx.state.user.id,
id: note.id
}).update(note);
this.json({ code: 0, data, msg: `备忘更新成功` });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
// 更新
async delNoteAction() {
let note = this.post();
note.userId = this.ctx.state.user.id;
try {
let data = await this.model("notes").where(note).delete();
this.json({ code: 0, data, msg: `备忘删除成功` });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
async notesAction() {
let where = {};
try {
let data = await this.model('notes').where(where).order("createdAt DESC").page(this.get('page'), this.get('pageSize')).countSelect();
this.json({ code: 0, data });
} catch (error) {
this.json({ code: 1, msg: error.toString() });
}
}
};

View File

@ -4,38 +4,31 @@ app.controller('bookmarkInfoCtr', ['$scope', '$state', '$timeout', '$sce', '$win
$scope.content = '';
$scope.loading = false;
pubSubService.subscribe('TagCtr.showBookmarkInfo', $scope, function (event, bookmark) {
pubSubService.subscribe('TagCtr.showBookmarkInfo', $scope, async function (event, bookmark) {
console.log('subscribe TagCtr.showBookmarkInfo', bookmark);
$('.ui.modal.js-bookmark-info').modal({
closable: false,
}).modal('setting', 'transition', dataService.animation()).modal('show');
bookmark.favicon_url = 'http://favicon.luchenqun.com/?url=' + bookmark.url;
bookmark.snap_url = bookmark.snap_url || ('./images/snap/' + bookmark.id + '.png');
$scope.bookmark = bookmark;
$scope.bookmark.description = $sce.trustAsHtml(bookmark.description);
$scope.content = $sce.trustAsHtml(bookmark.content) || '';
var params = {
url: bookmark.url,
requestId: 1
}
if (!$scope.content) {
$timeout(function () {
$('.ui.modal.js-bookmark-info').modal("refresh");
$("p").css("word-wrap", "break-word");
}, 500);
$scope.loading = true
bookmarkService.getArticle(params)
.then((data) => {
$scope.loading = true;
try {
let data = get("getArticle", { url: bookmark.url });
$scope.content = data.content ? $sce.trustAsHtml(data.content) : $sce.trustAsHtml('<p>数据获取失败可能是服务器不允许获取或者是https网站</p>');
setTimeout(function () {
$('.ui.modal.js-bookmark-info').modal && $('.ui.modal.js-bookmark-info').modal("refresh");
}, 100);
} catch (error) {
}
$scope.loading = false;
})
.catch((err) => {
$scope.content = $sce.trustAsHtml('<p>数据获取失败:' + JSON.stringify(err) + '</p>');
$scope.loading = false;
})
} else {
setTimeout(function () {
$('.ui.modal.js-bookmark-info').modal && $('.ui.modal.js-bookmark-info').modal("refresh");
@ -46,14 +39,12 @@ app.controller('bookmarkInfoCtr', ['$scope', '$state', '$timeout', '$sce', '$win
}
});
$scope.jumpToUrl = function (url, id) {
$scope.jumpToUrl = async function (url, id) {
$window.open(url, '_blank');
if ($scope.bookmark.own) {
bookmarkService.clickBookmark({
id: id
});
$scope.bookmark.click_count += 1;
$scope.bookmark.last_click = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
await post('clickBookmark', { id });
$scope.bookmark.clickCount += 1;
$scope.bookmark.lastClick = $filter("date")(new Date(), "yyyy-MM-dd HH:mm:ss");
}
}

View File

@ -52,11 +52,10 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
}
}
$scope.jumpToUrl = function (url, id) {
$scope.jumpToUrl = async function (url, id) {
$window.open(url, '_blank');
bookmarkService.clickBookmark({
id: id
});
await post("clickBookmark", { id });
if ($scope.showStyle != 'navigate') {
var bookmarks = $scope.showStyle == 'table' ? $scope.bookmarkData.bookmarks : $scope.bookmarkData;
@ -107,13 +106,11 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
});
}
$scope.editBookmark = function (bookmarkId) {
pubSubService.publish('bookmarksCtr.editBookmark', {
'bookmarkId': bookmarkId
});
$scope.editBookmark = function (id) {
pubSubService.publish('bookmarksCtr.editBookmark', { id });
}
$scope.detailBookmark = function (b) {
$scope.detailBookmark = async function (b) {
var bookmark = $.extend(true, {}, b); // 利用jQuery执行深度拷贝
bookmark.own = true;
if ($scope.showStyle == 'navigate') {
@ -123,9 +120,7 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
}];
}
pubSubService.publish('TagCtr.showBookmarkInfo', bookmark);
bookmarkService.clickBookmark({
id: bookmark.id
});
await post("clickBookmark", { id: bookmark.id });
}
$scope.copy = function (url) {

View File

@ -5,7 +5,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
var cancelDefault = false;
init();
$scope.$watch('url', function (newUrl, oldUrl, scope) {
$scope.$watch('url', async function (newUrl, oldUrl, scope) {
$timeout(function () {
$scope.urlError = $scope.url == '' && $('.ui.modal.js-add-bookmark').modal('is active');
});
@ -17,8 +17,8 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
requestId: 0,
}
$scope.loadTitle = true;
bookmarkService.getArticle(params)
.then((data) => {
try {
let data = await get('getArticle', { url: newUrl });
$scope.loadTitle = false;
$scope.originTitle = data.title;
$scope.title = data.title;
@ -28,12 +28,10 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
} else {
$scope.title = data.title.split('-')[0].trim();
}
})
.catch((err) => {
console.log('getTitle err', err);
} catch (error) {
toastr.error('获取书签标题失败:' + JSON.stringify(err) + ',请手动填入', "提示");
$scope.loadTitle = false;
})
}
}
}
});
@ -84,7 +82,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
return;
}
if ($scope.tagsError) {
toastr.error('您至少要选择一个分类!最多选择三个分类!如果暂时没想到放到哪个分类,可以先选择未分类', "错误");
toastr.error('您至少要选择一个分类!如果暂时没想到放到哪个分类,可以先选择未分类', "错误");
return;
}
if ($scope.titleError) {
@ -98,16 +96,10 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
$('.ui.modal.js-add-bookmark').modal('hide');
pubSubService.publish('EditCtr.inserBookmarsSuccess', params);
} else {
bookmarkService.updateBookmark(params)
.then((data) => {
await post('updateBookmark', params);
$('.ui.modal.js-add-bookmark').modal('hide');
pubSubService.publish('EditCtr.inserBookmarsSuccess', data);
toastr.success('[ ' + params.title + ' ] 更新成功,将自动重新更新书签!', "提示");
})
.catch((err) => {
console.log('updateBookmark err', err);
toastr.error('[ ' + params.title + ' ] 更新失败' + JSON.stringify(err), "提示");
});
}
}
@ -168,7 +160,7 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
getTags();
});
pubSubService.subscribe('bookmarksCtr.editBookmark', $scope, function (event, params) {
pubSubService.subscribe('bookmarksCtr.editBookmark', $scope, async function (event, params) {
console.log('subscribe bookmarksCtr.editBookmark', params);
$('.ui.modal.js-add-bookmark').modal({
closable: false,
@ -178,36 +170,24 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
}, 500);
$scope.add = false;
$scope.loadTags = true;
cancelDefault = false;
bookmarkService.getBookmark(params)
.then((data) => {
console.log('getBookmark ', data);
var bookmark = data.bookmark;
$scope.autoGettitle = false;
cancelDefault = false;
let bookmark = await get("bookmark", params);
let tags = await get("tags");
$scope.id = (bookmark && bookmark.id) || '';
$scope.url = (bookmark && bookmark.url) || '';
$scope.title = (bookmark && bookmark.title) || '';
$scope.description = (bookmark && bookmark.description) || '';
$scope.tags = data.tags.map((tag) => {
tag.clicked = false;
$scope.tags = tags.map((tag) => {
tag.clicked = bookmark.tagId == tag.id;
return tag;
});
$scope.public = (bookmark && bookmark.id) || '1';
$('.ui.checkbox.js-public').checkbox((bookmark && bookmark.public && bookmark.public == '1') ? 'set checked' : 'set unchecked')
$timeout(function () {
data.bookmarkTags.forEach((tagId) => {
$scope.tags.forEach((tag) => {
if (tag.id == tagId) {
tag.clicked = true;
}
})
});
});
$scope.loadTags = false;
})
.catch((err) => console.log('updateBookmark err', err));
});
pubSubService.subscribe('TagCtr.storeBookmark', $scope, function (event, bookmark) {

View File

@ -26,12 +26,12 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
$scope.loginMenus = dataService.loginMenus; // 登陆之后显示的菜单数据。uiSerf内部跳转链接。
$scope.notLoginMenus = dataService.notLoginMenus; // 未登陆显示的菜单数据
(async () => {
$scope.user = await get('own');
if (data.username === 'lcq') {
get('own').then(user => {
$scope.user = user;
if ($scope.user.username === 'lcq') {
$scope.loginMenus[dataService.LoginIndexHot].show = false;
}
})();
});
$scope.toggleReady = function (ready) {
if (ready) {

View File

@ -26,19 +26,13 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
var timeagoInstance = timeago();
bookmarkService.autoLogin()
.then((data) => {
var login = data.logined;
var index = login ? dataService.LoginIndexNote : dataService.NotLoginIndexLogin;
get('own').then(user => {
pubSubService.publish('Common.menuActive', {
login: login,
index: index
login: true,
index: dataService.LoginIndexNote
});
getTags();
getNotes();
})
.catch((err) => {
dataService.netErrorHandle(err, $state)
});
$scope.changeCurrentPage = function (currentPage) {
@ -85,7 +79,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
}
}
$scope.addNote = function (close) {
$scope.addNote = async function (close) {
if ($scope.content == '') {
toastr.error('不允许备忘录内容为空!', "提示");
return;
@ -100,7 +94,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$scope.tags.forEach((tag) => {
if ($scope.currentTagId === tag.id) {
tagName = tag.name;
tag.ncnt += 1;
tag.noteCount += 1;
}
if (!$scope.currentTagId) {
if (tag.name == '未分类') {
@ -111,12 +105,12 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
})
var note = {
tag_id: $scope.currentTagId,
tagId: $scope.currentTagId,
content: $scope.content,
}
bookmarkService.addNote(note)
.then((data) => {
await post("addNote", note);
// 增加成功,重新获取一次备忘录
$scope.tags.forEach((tag) => {
tag.clicked = false;
@ -127,11 +121,6 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$scope.currentPage = 1;
$scope.searchWord = '';
getNotes();
})
.catch((err) => {
console.log('addNote err', err);
$scope.currentTagId = null;
});
}
$scope.copy = function (content, $event) {
@ -151,15 +140,13 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
});
}
$scope.confirmDelNote = function () {
$scope.confirmDelNote = async function () {
if ($scope.currentNoteId) {
var params = {
id: $scope.currentNoteId
}
ngDialog.close(dialog);
bookmarkService.delNote(params)
.then((data) => {
if (data.result == 1) {
await post('delNote', params)
$("#" + $scope.currentNoteId).transition({
animation: dataService.animation(),
duration: 500,
@ -167,15 +154,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$("#" + $scope.currentNoteId).remove();
}
});
toastr.success('备忘删除成功!', "提示");
$scope.totalItems -= 1;
} else {
toastr.error('没有找到对应的备忘录,删除失败!请刷新页面再尝试', "提示");
}
})
.catch((err) => {
toastr.error('备忘删除失败!错误提示:' + JSON.stringify(err), "提示");
});
} else {
toastr.error('删除失败!请刷新页面再尝试', "提示");
}
@ -190,7 +169,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
updateSelectTag(tagId);
}
$scope.updateNote = function () {
$scope.updateNote = async function () {
if (!$scope.content) {
toastr.error('更新失败,更新内容不能为空', "提示");
return;
@ -211,13 +190,10 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
var params = {
id: $scope.currentNoteId,
content: $scope.content,
tag_id: $scope.currentTagId,
tagId: $scope.currentTagId,
}
bookmarkService.updateNote(params)
.then((data) => {
if (data.result == 1) {
toastr.success('备忘更新成功!', "提示");
await post("updateNote", params);
$scope.notes.forEach((note) => {
if (note.id == $scope.currentNoteId) {
note.content = $scope.content;
@ -228,13 +204,6 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
})
$scope.add = false;
$scope.edit = false;
} else {
toastr.error('备忘更新失败!请刷新页面再尝试', "提示");
}
})
.catch((err) => {
toastr.error('备忘更新失败!错误提示:' + JSON.stringify(err), "提示");
});
}
$scope.detailNote = function (content) {
@ -301,28 +270,16 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
dataService.clipboard(`https://mybookmark.cn/api/notes/?shareNote=${note.id}`);
toastr.info(`将地址 https://mybookmark.cn/api/notes/?shareNote=${note.id} 发给别人粘贴到浏览器地址栏就可以访问到你分享的备忘啦!`, "提示");
}, time)
}
$scope.updatePublic = function (note, public) {
$scope.updatePublic = async function (note, public) {
var params = {
id: note.id,
public: public,
}
bookmarkService.updateNotePublic(params)
.then((data) => {
if (data.result == 1) {
public == 1 && toastr.success('备忘已由私密状态转为公开状态', "提示");
public == 0 && toastr.success('备忘已由公开状态转为私密状态', "提示");
await post("updateNode", params);
note.public = public;
} else {
toastr.error('备忘状态更新失败', "提示");
}
})
.catch((err) => {
toastr.error('备忘更新失败!错误提示:' + JSON.stringify(err), "提示");
});
}
function updateSelectTag(tagId) {
@ -353,20 +310,19 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
})
});
function getNotes(tagId) {
async function getNotes(tagId) {
$scope.notes = [];
$scope.loadBusy = true;
var params = {
currentPage: $scope.currentPage,
perPageItems: perPageItems,
page: $scope.currentPage,
pageSize: perPageItems,
searchWord: $scope.searchWord,
tagId: tagId || $scope.currentTagId
};
if (tagId || $scope.currentTagId) {
params.tagId = tagId || $scope.currentTagId;
}
bookmarkService.getNotes(params)
.then((data) => {
$scope.notes = data.notes;
try {
let reply = await get("notes", params);
$scope.notes = reply.data;
$scope.notes.forEach((note) => {
note.brief = note.content || "";
while (note.brief.indexOf("\n") > 0) {
@ -374,8 +330,8 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
}
note.brief = " " + note.brief.substring(0, 200) + (note.content.length > 200 ? " ......" : "");
})
$scope.totalPages = Math.ceil(data.totalItems / perPageItems);
$scope.totalItems = data.totalItems;
$scope.totalPages = reply.totalPages;
$scope.totalItems = reply.count;
$timeout(function () {
timeagoInstance.cancel();
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
@ -390,36 +346,26 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$(".js-note").removeClass("hidden");
}
transition();
})
.catch((err) => {
} catch (error) {
$scope.notes = [];
$scope.loadBusy = false;
});
}
}
function getTags(params) {
async function getTags() {
$scope.loadBusy = true;
bookmarkService.getTags(params)
.then((data) => {
$scope.tags = []
var find = false;
data.forEach((tag) => {
let tags = await get('tags', { noteCount: true });
let find = false;
tags.forEach((tag) => {
$scope.tags.push(tag);
if (tag.id == $scope.currentTagId) {
find = true; // 如果是删了分类返回来,那么要重新默认选中第一个分类
}
})
if (!find) $scope.currentTagId = null;
if ($scope.currentTagId) {
getTags($scope.currentTagId);
}
$scope.loadBusy = false;
})
.catch((err) => {
console.log('getTags err', err);
$scope.loadBusy = false;
});
}
$('.js-note-card').transition('hide');

View File

@ -62,12 +62,11 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
toastr.warning("请输入搜索关键字再进行查询!", "提示");
}
$scope.jumpToUrl = function (url, id) {
$scope.jumpToUrl = async function (url, id) {
if (!$scope.edit) {
$window.open(url);
bookmarkService.clickBookmark({
id: id
});
await post("clickBookmark", { id });
$scope.searchBookmarks.forEach(function (bookmark) {
if (bookmark.id == id && bookmark.own) {
bookmark.click_count += 1;
@ -111,10 +110,8 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
});
}
$scope.editBookmark = function (bookmarkId) {
pubSubService.publish('bookmarksCtr.editBookmark', {
'bookmarkId': bookmarkId
});
$scope.editBookmark = function (id) {
pubSubService.publish('bookmarksCtr.editBookmark', { id });
}
$scope.detailBookmark = function (bookmark) {

View File

@ -91,12 +91,11 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
}
}
$scope.jumpToUrl = function (url, id) {
$scope.jumpToUrl = async function (url, id) {
if (!$scope.editMode) {
$window.open(url, '_blank');
bookmarkService.clickBookmark({
id: id
});
await post("clickBookmark", { id });
$scope.bookmarks.forEach(function (bookmark, index) {
if (bookmark.id == id) {
bookmark.click_count += 1;
@ -149,18 +148,15 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
});
}
$scope.editBookmark = function (bookmarkId) {
pubSubService.publish('bookmarksCtr.editBookmark', {
'bookmarkId': bookmarkId
});
$scope.editBookmark = function (id) {
console.log('publish bookmarksCtr.editBookmark', { id });
pubSubService.publish('bookmarksCtr.editBookmark', { id });
}
$scope.detailBookmark = function (bookmark) {
$scope.detailBookmark = async function (bookmark) {
bookmark.own = true;
pubSubService.publish('TagCtr.showBookmarkInfo', bookmark);
bookmarkService.clickBookmark({
id: bookmark.id
});
await post("clickBookmark", { id: bookmark.id });
}
$scope.copy = function (url) {

View File

@ -22,12 +22,12 @@
</div>
<div class="column">
<i class="calendar icon"></i>最后点击:
<span>{{bookmark.last_click}}</span>
<span>{{bookmark.lastClick}}</span>
</div>
</div>
<div class="two column row">
<div class="column" ng-if="bookmark.click_count">
<i class="hand pointer icon"></i>点击次数:{{bookmark.click_count}}
<div class="column" ng-if="bookmark.clickCount">
<i class="hand pointer icon"></i>点击次数:{{bookmark.clickCount}}
</div>
<div class="column" ng-if="bookmark.fav_count">
<i class="heart icon"></i>收藏人数:{{bookmark.fav_count}}

View File

@ -1,6 +1,6 @@
<div class="ui segment js-note-card" style="padding:14px 0px 0px 0px;">
<div class="ui container" style="padding-left:14px">
<div class="ui label" style="margin:3px 15px 8px 0px;cursor:default;" ng-class="{green:tag.clicked}" ng-repeat="tag in tags" ng-click="clickTag(tag.id)" ng-show="tag.ncnt || add">{{ tag.name }} ({{ tag.ncnt || 0 }})</div>
<div class="ui label" style="margin:3px 15px 8px 0px;cursor:default;" ng-class="{green:tag.clicked}" ng-repeat="tag in tags" ng-click="clickTag(tag.id)" ng-show="tag.noteCount || add">{{ tag.name }} ({{ tag.noteCount || 0 }})</div>
<div class="ui label" style="margin:3px 15px 8px 0px;cursor:default;" ng-click="showAddNote()" data-tooltip="点击添加备忘。你也可以在任意界面按快捷键A(不区分大小写)增加备忘录。">
<i class="plus icon" style="margin-right:0px;"></i>
</div>