From 2b55b1acde84ca28a68f9ef0e5515efe78b47ebd Mon Sep 17 00:00:00 2001 From: Kaviilee Date: Sat, 26 Oct 2024 17:08:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A8=8D=E5=90=8E=E5=86=8D=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/thx.less | 1 + assets/js/stat.js | 15 +++++- package-lock.json | 32 ++++++------- package.json | 6 +-- service/fav.js | 12 ++++- src/interact/WatchLater.vue | 93 +++++++++++++++++++++++++++++++++++++ src/single/Thx.vue | 3 ++ yarn.lock | 21 +++++---- 8 files changed, 154 insertions(+), 29 deletions(-) create mode 100644 src/interact/WatchLater.vue diff --git a/assets/css/thx.less b/assets/css/thx.less index 6c23b51..53ef7d4 100644 --- a/assets/css/thx.less +++ b/assets/css/thx.less @@ -2,6 +2,7 @@ .w-like2, .w-fav2, .w-boxcoin-user, + .w-share2, .w-boxcoin-admin { .mr(20px); } diff --git a/assets/js/stat.js b/assets/js/stat.js index 230c7ec..148d08a 100644 --- a/assets/js/stat.js +++ b/assets/js/stat.js @@ -2,6 +2,7 @@ import { Reporter } from "@jx3box/reporter" import { __Domain } from "@jx3box/jx3box-common/data/jx3box.json"; +// import { $next } from "@jx3box/jx3box-common/js/https_v2"; /** * 16进制转int @@ -51,7 +52,6 @@ function getUUID(domain = __Domain) { // 统计指令 const stat = { - /** * 上报指令 vue2 * @param {string} user_id 用户id 使用User.getInfo().uid获取 @@ -89,4 +89,17 @@ const stat = { } } +/** + * 添加历史记录 + * @param {*} data + * @param {*} data.source_type 例如:macro,community + * @param {*} data.source_id 例如:文章id,帖子id + * @param {*} data.link 例如:文章链接,帖子链接 + * @param {*} data.title 例如:文章标题,帖子标题 + * @returns + */ +// export function postHistory(data) { +// return $next({mute: true}).post("/api/next2/userdata/visit-history/item", data); +// } + export default stat; diff --git a/package-lock.json b/package-lock.json index 29211d8..dde2409 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@jx3box/jx3box-vue3-ui", - "version": "0.9.3", + "version": "0.9.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@jx3box/jx3box-vue3-ui", - "version": "0.9.3", + "version": "0.9.4", "dependencies": { "@element-plus/icons-vue": "^2.1.0", - "@jx3box/jx3box-common": "^8.4.1", - "@jx3box/jx3box-data": "^3.6.9", + "@jx3box/jx3box-common": "^8.4.3", + "@jx3box/jx3box-data": "^3.7.0", "@jx3box/jx3box-emotion": "^1.2.8", "@jx3box/jx3box-macro": "^1.0.1", "@jx3box/jx3box-talent": "^1.3.2", @@ -2000,9 +2000,9 @@ } }, "node_modules/@jx3box/jx3box-common": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@jx3box/jx3box-common/-/jx3box-common-8.4.1.tgz", - "integrity": "sha512-EaWD37juB7mWRE8TJuQL24NU9JjX1arRBOaIXIQPlcat8MkoHLDeBaOXeONfZeDcvahcd2f6ZhgA8AjOjE/VdA==", + "version": "8.4.3", + "resolved": "https://registry.npmjs.org/@jx3box/jx3box-common/-/jx3box-common-8.4.3.tgz", + "integrity": "sha512-BTK6h/RTZxzWwTOrAjR10eOfN9uapOaDsxAeWruKlRkXCmhUdyp/EWpPy6iAO+tGuHzWQHama4XNIQq3Vv2pEQ==", "dependencies": { "@jx3box/reporter": "^0.0.5", "axios": "^1.6.8", @@ -2224,9 +2224,9 @@ } }, "node_modules/@jx3box/jx3box-data": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/@jx3box/jx3box-data/-/jx3box-data-3.6.9.tgz", - "integrity": "sha512-KCWuruEb3nR5JpuAyT7V/L8hP5zFrR7OKNUZQkA6k4WreyqPqaHrMHmkEsFs0/kxS5K46QyF26rOr11lVrdsTA==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@jx3box/jx3box-data/-/jx3box-data-3.7.0.tgz", + "integrity": "sha512-/SxD/D2chKuSEfflBTSKDxLnAYFNGITL91DZF5xlAjAvmRCqJAryCxCrlcHOhCE56lW7zJjDMo4r6qiuMDpbVg==" }, "node_modules/@jx3box/jx3box-emotion": { "version": "1.2.8", @@ -15911,9 +15911,9 @@ } }, "@jx3box/jx3box-common": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@jx3box/jx3box-common/-/jx3box-common-8.4.1.tgz", - "integrity": "sha512-EaWD37juB7mWRE8TJuQL24NU9JjX1arRBOaIXIQPlcat8MkoHLDeBaOXeONfZeDcvahcd2f6ZhgA8AjOjE/VdA==", + "version": "8.4.3", + "resolved": "https://registry.npmjs.org/@jx3box/jx3box-common/-/jx3box-common-8.4.3.tgz", + "integrity": "sha512-BTK6h/RTZxzWwTOrAjR10eOfN9uapOaDsxAeWruKlRkXCmhUdyp/EWpPy6iAO+tGuHzWQHama4XNIQq3Vv2pEQ==", "requires": { "@jx3box/reporter": "^0.0.5", "axios": "^1.6.8", @@ -16084,9 +16084,9 @@ } }, "@jx3box/jx3box-data": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/@jx3box/jx3box-data/-/jx3box-data-3.6.9.tgz", - "integrity": "sha512-KCWuruEb3nR5JpuAyT7V/L8hP5zFrR7OKNUZQkA6k4WreyqPqaHrMHmkEsFs0/kxS5K46QyF26rOr11lVrdsTA==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@jx3box/jx3box-data/-/jx3box-data-3.7.0.tgz", + "integrity": "sha512-/SxD/D2chKuSEfflBTSKDxLnAYFNGITL91DZF5xlAjAvmRCqJAryCxCrlcHOhCE56lW7zJjDMo4r6qiuMDpbVg==" }, "@jx3box/jx3box-emotion": { "version": "1.2.8", diff --git a/package.json b/package.json index 1576253..7c91987 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jx3box/jx3box-vue3-ui", - "version": "0.9.4", + "version": "0.9.5", "description": "JX3BOX Vue3 UI", "main": "index.js", "scripts": { @@ -26,8 +26,8 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.1.0", - "@jx3box/jx3box-common": "^8.4.1", - "@jx3box/jx3box-data": "^3.6.9", + "@jx3box/jx3box-common": "^8.4.3", + "@jx3box/jx3box-data": "^3.7.0", "@jx3box/jx3box-emotion": "^1.2.8", "@jx3box/jx3box-macro": "^1.0.1", "@jx3box/jx3box-talent": "^1.3.2", diff --git a/service/fav.js b/service/fav.js index b2fdf68..7eb14a2 100644 --- a/service/fav.js +++ b/service/fav.js @@ -14,4 +14,14 @@ function addFav(post_type, post_id, post_title) { function delFav(id) { return $n.delete(`api/article/favorites/my/${id}`); } -export { hasFav, addFav, delFav }; + +// 稍后再看 +function addWatchLater(data) { + return $n.post(`api/next2/userdata/favorite/item`, data) +} + +function delWatchLater(params) { + return $n.delete(`api/next2/userdata/favorite/item`, { params }) +} + +export { hasFav, addFav, delFav, addWatchLater, delWatchLater }; diff --git a/src/interact/WatchLater.vue b/src/interact/WatchLater.vue new file mode 100644 index 0000000..b468b59 --- /dev/null +++ b/src/interact/WatchLater.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/single/Thx.vue b/src/single/Thx.vue index 39a7b32..668ef8b 100644 --- a/src/single/Thx.vue +++ b/src/single/Thx.vue @@ -30,6 +30,7 @@ :client="finalClient" /> +