@jx3box/jx3box-common-ui 9.0.0 → 9.0.2
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/assets/css/author.less +15 -0
- package/package.json +2 -2
- package/src/Author.vue +12 -4
- package/src/author/AuthorFollow.vue +3 -3
- package/src/author/AuthorRss.vue +155 -0
- package/src/interact/Rss.vue +7 -0
- package/src/single/Thx.vue +1 -1
package/assets/css/author.less
CHANGED
|
@@ -75,6 +75,21 @@
|
|
|
75
75
|
.u-block{
|
|
76
76
|
.mt(20px);
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
.u-btn {
|
|
80
|
+
&:hover {
|
|
81
|
+
.u-msg-icon {
|
|
82
|
+
filter: invert(33%) sepia(39%) saturate(6852%) hue-rotate(201deg) brightness(87%) contrast(98%);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.u-msg-icon {
|
|
88
|
+
.size(12px);
|
|
89
|
+
.pr;
|
|
90
|
+
top: 2px;
|
|
91
|
+
filter: invert(40%) sepia(5%) saturate(419%) hue-rotate(182deg) brightness(89%) contrast(84%);
|
|
92
|
+
}
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
.c-sidebar-left .c-author {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@jx3box/jx3box-comment-ui": "^1.9.9",
|
|
34
34
|
"@jx3box/jx3box-common": "^8.4.7",
|
|
35
|
-
"@jx3box/jx3box-data": "^3.
|
|
35
|
+
"@jx3box/jx3box-data": "^3.7.0",
|
|
36
36
|
"@jx3box/jx3box-editor": "^2.2.16",
|
|
37
37
|
"@jx3box/reporter": "^0.0.4",
|
|
38
38
|
"axios": "^0.26.1",
|
package/src/Author.vue
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
<AuthorInfo :uid="uid" @ready="installModules" />
|
|
4
4
|
<template v-if="data">
|
|
5
5
|
<div class="u-interact">
|
|
6
|
-
<AuthorFollow style="margin-right: 8px" :uid="uid" />
|
|
6
|
+
<!-- <AuthorFollow style="margin-right: 8px" :uid="uid" /> -->
|
|
7
|
+
<AuthorRss style="margin-right: 8px" :uid="uid" />
|
|
7
8
|
<!-- <AuthorGift :uid="uid" /> -->
|
|
8
|
-
<el-button
|
|
9
|
+
<el-button class="u-btn" size="mini" @click="onMessage">
|
|
10
|
+
<img class="u-msg-icon" svg-inline :src="src" />
|
|
11
|
+
私信
|
|
12
|
+
</el-button>
|
|
9
13
|
</div>
|
|
10
14
|
<!-- <AuthorMsg :uid="uid" /> -->
|
|
11
15
|
<AuthorLink class="u-block u-links" :uid="uid" :data="data" />
|
|
@@ -21,19 +25,22 @@
|
|
|
21
25
|
<script>
|
|
22
26
|
import AuthorInfo from "./author/AuthorInfo.vue";
|
|
23
27
|
import AuthorLink from "./author/AuthorLink.vue";
|
|
24
|
-
import AuthorFollow from "./author/AuthorFollow.vue";
|
|
28
|
+
// import AuthorFollow from "./author/AuthorFollow.vue";
|
|
25
29
|
// import AuthorMsg from "./author/AuthorMsg.vue";
|
|
26
30
|
// import AuthorGift from "./author/AuthorGift.vue";
|
|
27
31
|
// import AuthorFans from "./author/AuthorFans.vue";
|
|
28
32
|
import AuthorMedals from "./author/AuthorMedals.vue";
|
|
29
33
|
import AuthorTeams from "./author/AuthorTeams.vue";
|
|
30
34
|
import AuthorPosts from "./author/AuthorPosts.vue";
|
|
35
|
+
import AuthorRss from "./author/AuthorRss.vue";
|
|
36
|
+
import {__cdn} from "@jx3box/jx3box-common/data/jx3box.json";
|
|
31
37
|
export default {
|
|
32
38
|
name: "Author",
|
|
33
39
|
props: ["uid"],
|
|
34
40
|
data: function () {
|
|
35
41
|
return {
|
|
36
42
|
data: "",
|
|
43
|
+
src: __cdn + "design/vector/icon/message.svg",
|
|
37
44
|
};
|
|
38
45
|
},
|
|
39
46
|
methods: {
|
|
@@ -47,13 +54,14 @@ export default {
|
|
|
47
54
|
components: {
|
|
48
55
|
AuthorInfo,
|
|
49
56
|
AuthorLink,
|
|
50
|
-
AuthorFollow,
|
|
57
|
+
// AuthorFollow,
|
|
51
58
|
// AuthorMsg,
|
|
52
59
|
// AuthorGift,
|
|
53
60
|
AuthorMedals,
|
|
54
61
|
AuthorTeams,
|
|
55
62
|
AuthorPosts,
|
|
56
63
|
// AuthorFans,
|
|
64
|
+
AuthorRss,
|
|
57
65
|
},
|
|
58
66
|
};
|
|
59
67
|
</script>
|
|
@@ -157,9 +157,9 @@ export default {
|
|
|
157
157
|
cursor: default;
|
|
158
158
|
&:hover {
|
|
159
159
|
cursor: pointer;
|
|
160
|
-
background-color: @light-pink
|
|
161
|
-
color: #fff
|
|
162
|
-
border-color: darken(@light-pink, 2%)
|
|
160
|
+
background-color: @light-pink;
|
|
161
|
+
color: #fff;
|
|
162
|
+
border-color: darken(@light-pink, 2%);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-author-rss">
|
|
3
|
+
<el-button
|
|
4
|
+
class="u-btn"
|
|
5
|
+
:class="{ 'u-fans-box': isSelf }"
|
|
6
|
+
size="mini"
|
|
7
|
+
plain
|
|
8
|
+
@click="subscribe"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
:disabled="isSelf"
|
|
11
|
+
>
|
|
12
|
+
<img class="u-icon" svg-inline :src="src" />
|
|
13
|
+
{{ btnText }}</el-button
|
|
14
|
+
>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { getAuthorRss, subscribeAuthor, unsubscribeAuthor } from "@jx3box/jx3box-common/js/rss";
|
|
20
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
21
|
+
import { __cdn } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
22
|
+
export default {
|
|
23
|
+
name: "AuthorRss",
|
|
24
|
+
props: {
|
|
25
|
+
uid: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 0,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
subscribed: false,
|
|
33
|
+
fansNum: 0,
|
|
34
|
+
loading: false,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
btnText() {
|
|
39
|
+
return this.subscribed ? "已订阅" : "订阅";
|
|
40
|
+
},
|
|
41
|
+
btnType() {
|
|
42
|
+
return !this.subscribed ? "info" : "warning";
|
|
43
|
+
},
|
|
44
|
+
isSelf() {
|
|
45
|
+
return this.uid == this.user.uid;
|
|
46
|
+
},
|
|
47
|
+
user() {
|
|
48
|
+
return User.getInfo();
|
|
49
|
+
},
|
|
50
|
+
isLogin: function () {
|
|
51
|
+
return User.isLogin();
|
|
52
|
+
},
|
|
53
|
+
src() {
|
|
54
|
+
return __cdn + "design/vector/icon/rss_author.svg";
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
uid: {
|
|
59
|
+
immediate: true,
|
|
60
|
+
handler(val) {
|
|
61
|
+
val && this.loadRss();
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
// 格式化粉丝数
|
|
67
|
+
formatFansNum(num) {
|
|
68
|
+
if (num < 10000) {
|
|
69
|
+
return num === 0 ? "" : num;
|
|
70
|
+
} else {
|
|
71
|
+
return (num / 10000).toFixed(1) + "万";
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
// 关注
|
|
75
|
+
subscribe() {
|
|
76
|
+
if (!this.isLogin) {
|
|
77
|
+
User.toLogin();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (this.subscribed) {
|
|
81
|
+
this.unsubscribe({ id: this.uid });
|
|
82
|
+
} else {
|
|
83
|
+
subscribeAuthor({ id: this.uid })
|
|
84
|
+
.then((res) => {
|
|
85
|
+
this.subscribed = true;
|
|
86
|
+
})
|
|
87
|
+
.catch((err) => {
|
|
88
|
+
console.log(err);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
// 取消订阅
|
|
93
|
+
unsubscribe() {
|
|
94
|
+
// this.$confirm("是否取消订阅", "提示", {
|
|
95
|
+
// confirmButtonText: "确定",
|
|
96
|
+
// cancelButtonText: "取消",
|
|
97
|
+
// type: "warning",
|
|
98
|
+
// }).then(() => {
|
|
99
|
+
unsubscribeAuthor({ id: this.uid })
|
|
100
|
+
.then((res) => {
|
|
101
|
+
this.$message.success("操作成功");
|
|
102
|
+
this.subscribed = false;
|
|
103
|
+
})
|
|
104
|
+
.catch((err) => {
|
|
105
|
+
console.log(err);
|
|
106
|
+
});
|
|
107
|
+
// });
|
|
108
|
+
},
|
|
109
|
+
loadRss() {
|
|
110
|
+
this.loading = true;
|
|
111
|
+
getAuthorRss({ id: this.uid })
|
|
112
|
+
.then((res) => {
|
|
113
|
+
this.fansNum = res.data.data.total || 0;
|
|
114
|
+
this.subscribed = res.data.data.subscribed;
|
|
115
|
+
})
|
|
116
|
+
.catch((err) => {
|
|
117
|
+
console.log(err);
|
|
118
|
+
})
|
|
119
|
+
.finally(() => {
|
|
120
|
+
this.loading = false;
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<style lang="less">
|
|
128
|
+
.c-author-rss {
|
|
129
|
+
.u-btn.el-button {
|
|
130
|
+
cursor: default;
|
|
131
|
+
&:hover {
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
background-color: @light-pink;
|
|
134
|
+
color: #fff;
|
|
135
|
+
border-color: darken(@light-pink, 2%);
|
|
136
|
+
|
|
137
|
+
.u-icon {
|
|
138
|
+
filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(198deg) brightness(104%) contrast(101%);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.u-icon {
|
|
143
|
+
.size(12px);
|
|
144
|
+
.pr;
|
|
145
|
+
top: 2px;
|
|
146
|
+
filter: invert(40%) sepia(5%) saturate(419%) hue-rotate(182deg) brightness(89%) contrast(84%);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media screen and (max-width: @phone) {
|
|
151
|
+
.el-message-box {
|
|
152
|
+
max-width: 60%;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</style>
|
package/src/interact/Rss.vue
CHANGED
|
@@ -42,6 +42,10 @@ export default {
|
|
|
42
42
|
type: Boolean,
|
|
43
43
|
default: false,
|
|
44
44
|
},
|
|
45
|
+
title: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "",
|
|
48
|
+
},
|
|
45
49
|
},
|
|
46
50
|
data() {
|
|
47
51
|
return {
|
|
@@ -87,6 +91,9 @@ export default {
|
|
|
87
91
|
return {
|
|
88
92
|
type: this.type,
|
|
89
93
|
id: this.id,
|
|
94
|
+
data: {
|
|
95
|
+
title: this.title
|
|
96
|
+
}
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
99
|
isLogin() {
|
package/src/single/Thx.vue
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
/>
|
|
39
39
|
<Like :postId="postId" :postType="postType"></Like>
|
|
40
40
|
<fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
|
|
41
|
-
<Rss v-if="showRss" :type="postType" :id="postId"></Rss>
|
|
41
|
+
<Rss v-if="showRss" :type="postType" :id="postId" :title="postTitle"></Rss>
|
|
42
42
|
<boxcoin-user
|
|
43
43
|
v-if="userBoxcoinEnable && boxcoin_enable && allowGift"
|
|
44
44
|
:postId="postId"
|