@jx3box/jx3box-ui 2.2.10 → 2.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/service/suspend.js +2 -1
- package/src/SuspendCommon.vue +14 -4
- package/src/single/SimpleThx.vue +8 -1
- package/src/stories/layout/SuspendCommon.stories.js +1 -0
- package/src/stories/single/RightAffix.stories.js +3 -0
- package/src/stories/single/SimpleThx.stories.js +2 -1
package/package.json
CHANGED
package/service/suspend.js
CHANGED
|
@@ -50,9 +50,10 @@ function later(data) {
|
|
|
50
50
|
return $next().post(`/api/next2/userdata/watch-later/item`, data);
|
|
51
51
|
}
|
|
52
52
|
// 收藏相关
|
|
53
|
-
function setCollect(id, type, post_title) {
|
|
53
|
+
function setCollect(id, type, post_title, author_id) {
|
|
54
54
|
return $next().post(`/api/article/favorites/add/${id}/${type}`, {
|
|
55
55
|
post_title: post_title,
|
|
56
|
+
author_id,
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
function getCollectList(id, type) {
|
package/src/SuspendCommon.vue
CHANGED
|
@@ -466,6 +466,7 @@ export default {
|
|
|
466
466
|
avatar: "", //作者头像
|
|
467
467
|
author_id: "", //作者id
|
|
468
468
|
},
|
|
469
|
+
author_id: "",
|
|
469
470
|
subscribeType: "", //订阅类型,用于区分调用百科、文章、作者、帖子等订阅接口,
|
|
470
471
|
postType: "", //订阅、收藏接口的type,如'face','bps','article'等
|
|
471
472
|
id: "", //页面数据ID,用于收藏订阅操作
|
|
@@ -500,6 +501,15 @@ export default {
|
|
|
500
501
|
fixIsActive() {
|
|
501
502
|
return this.fixList.some((item) => item.url === this.fixPageConfig.url);
|
|
502
503
|
},
|
|
504
|
+
authorId() {
|
|
505
|
+
return this.drawerConfig.author_id || this.drawerConfig.author?.author_id || "";
|
|
506
|
+
},
|
|
507
|
+
subscribeData() {
|
|
508
|
+
return {
|
|
509
|
+
title: this.drawerConfig.title,
|
|
510
|
+
author_id: this.authorId,
|
|
511
|
+
};
|
|
512
|
+
},
|
|
503
513
|
},
|
|
504
514
|
mounted() {
|
|
505
515
|
this.fixList = JSON.parse(localStorage.getItem(this.fixPageConfig.key)) || [];
|
|
@@ -590,7 +600,7 @@ export default {
|
|
|
590
600
|
this.collectInfo = {};
|
|
591
601
|
});
|
|
592
602
|
} else {
|
|
593
|
-
setCollect(conf.id, conf.postType, conf.title).then((res) => {
|
|
603
|
+
setCollect(conf.id, conf.postType, conf.title, this.authorId).then((res) => {
|
|
594
604
|
this.isCollect = true;
|
|
595
605
|
this.collectInfo = res.data?.data;
|
|
596
606
|
});
|
|
@@ -629,7 +639,7 @@ export default {
|
|
|
629
639
|
this.$emit("subscribe", { isSubscribe: false });
|
|
630
640
|
});
|
|
631
641
|
} else {
|
|
632
|
-
subscribePost(conf.id,
|
|
642
|
+
subscribePost(conf.id, this.subscribeData).then((res) => {
|
|
633
643
|
this.isSubscribe = true;
|
|
634
644
|
this.subscribeInfo = res.data?.data;
|
|
635
645
|
this.$emit("subscribe", { isSubscribe: true });
|
|
@@ -644,7 +654,7 @@ export default {
|
|
|
644
654
|
this.$emit("subscribe", { isSubscribe: false });
|
|
645
655
|
});
|
|
646
656
|
} else {
|
|
647
|
-
subscribeArticle(conf.postType, conf.id,
|
|
657
|
+
subscribeArticle(conf.postType, conf.id, this.subscribeData).then((res) => {
|
|
648
658
|
this.isSubscribe = true;
|
|
649
659
|
this.subscribeInfo = res.data?.data;
|
|
650
660
|
this.$emit("subscribe", { isSubscribe: true });
|
|
@@ -659,7 +669,7 @@ export default {
|
|
|
659
669
|
this.$emit("subscribe", { isSubscribe: false });
|
|
660
670
|
});
|
|
661
671
|
} else {
|
|
662
|
-
subscribeWiki(conf.postType, conf.id,
|
|
672
|
+
subscribeWiki(conf.postType, conf.id, this.subscribeData).then((res) => {
|
|
663
673
|
this.isSubscribe = true;
|
|
664
674
|
this.subscribeInfo = res.data?.data;
|
|
665
675
|
this.$emit("subscribe", { isSubscribe: true });
|
package/src/single/SimpleThx.vue
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
:client="client"
|
|
17
17
|
/>
|
|
18
18
|
<Like :postId="postId" :postType="postType"></Like>
|
|
19
|
-
<fav :postId="postId" :postType="postType" :postTitle="postTitle" :author_id="
|
|
19
|
+
<fav :postId="postId" :postType="postType" :postTitle="postTitle" :author_id="postAuthorId"></fav>
|
|
20
20
|
<boxcoin-user
|
|
21
21
|
:postId="postId"
|
|
22
22
|
:postType="postType"
|
|
@@ -96,6 +96,10 @@ export default {
|
|
|
96
96
|
type: [Number, String],
|
|
97
97
|
default: 0,
|
|
98
98
|
},
|
|
99
|
+
authorId: {
|
|
100
|
+
type: [Number, String],
|
|
101
|
+
default: 0,
|
|
102
|
+
},
|
|
99
103
|
authors: {
|
|
100
104
|
type: Array,
|
|
101
105
|
default: () => [],
|
|
@@ -150,6 +154,9 @@ export default {
|
|
|
150
154
|
post_keys: function () {
|
|
151
155
|
return [this.postId, this.postType];
|
|
152
156
|
},
|
|
157
|
+
postAuthorId: function () {
|
|
158
|
+
return this.authorId || this.userId;
|
|
159
|
+
},
|
|
153
160
|
},
|
|
154
161
|
watch: {
|
|
155
162
|
post_keys: {
|
|
@@ -13,6 +13,7 @@ const meta = {
|
|
|
13
13
|
postId: { control: 'number' },
|
|
14
14
|
postType: { control: 'text' },
|
|
15
15
|
postTitle: { control: 'text' },
|
|
16
|
+
authorId: { control: 'number' },
|
|
16
17
|
showComment: { control: 'boolean' },
|
|
17
18
|
},
|
|
18
19
|
};
|
|
@@ -24,6 +25,7 @@ export const Default = {
|
|
|
24
25
|
postId: 80449,
|
|
25
26
|
postType: 'bbs',
|
|
26
27
|
postTitle: '轻剑驭风版本攻略示例',
|
|
28
|
+
authorId: 8,
|
|
27
29
|
showComment: true,
|
|
28
30
|
},
|
|
29
31
|
render: (args) => ({
|
|
@@ -58,6 +60,7 @@ export const Default = {
|
|
|
58
60
|
{ name: 'postId', type: 'String | Number', default: '""', description: '当前文章 ID,用于收藏查询。' },
|
|
59
61
|
{ name: 'postType', type: 'String', default: '""', description: '文章类型,例如 bbs / pvx。' },
|
|
60
62
|
{ name: 'postTitle', type: 'String', default: '""', description: '文章标题,用于收藏请求。' },
|
|
63
|
+
{ name: 'authorId', type: 'String | Number', default: '""', description: '收藏请求携带的作者 UID。' },
|
|
61
64
|
{ name: 'showComment', type: 'Boolean | Number', default: 'false', description: '是否展示评论入口按钮。' },
|
|
62
65
|
],
|
|
63
66
|
};
|
|
@@ -22,6 +22,7 @@ export const Default = {
|
|
|
22
22
|
{ name: 'postType', type: 'String', default: '""', required: true, description: '文章类型。' },
|
|
23
23
|
{ name: 'postTitle', type: 'String', default: '""', description: '文章标题。' },
|
|
24
24
|
{ name: 'userId', type: 'Number | String', default: '0', description: '作者 UID。' },
|
|
25
|
+
{ name: 'authorId', type: 'Number | String', default: '0', description: '收藏请求携带的作者 UID,未传时回退到 userId。' },
|
|
25
26
|
{ name: 'adminBoxcoinEnable / userBoxcoinEnable', type: 'Boolean', default: 'false', description: '控制打赏区显示。' },
|
|
26
27
|
{ name: 'presetConfig', type: 'Object', default: '{}', description: 'Storybook 下可直接注入打赏配置,避免空态。' },
|
|
27
28
|
],
|
|
@@ -30,7 +31,7 @@ export const Default = {
|
|
|
30
31
|
template: `
|
|
31
32
|
<div style="display:grid;gap:24px;">
|
|
32
33
|
<section style="border-radius:20px;background:rgba(255,255,255,0.92);padding:24px;box-shadow:0 24px 60px rgba(15,23,42,0.08);">
|
|
33
|
-
<SimpleThx post-type="bbs" post-title="轻剑驭风版本攻略示例" :post-id="80449" :user-id="8" :admin-boxcoin-enable="true" :user-boxcoin-enable="true" :allow-gift="true" :preset-config="presetConfig" />
|
|
34
|
+
<SimpleThx post-type="bbs" post-title="轻剑驭风版本攻略示例" :post-id="80449" :user-id="8" :author-id="8" :admin-boxcoin-enable="true" :user-boxcoin-enable="true" :allow-gift="true" :preset-config="presetConfig" />
|
|
34
35
|
</section>
|
|
35
36
|
<StoryPropsTable title="SimpleThx" description="简化互动条组件。" :items="propsInfo" />
|
|
36
37
|
</div>
|