@jx3box/jx3box-common-ui 6.0.2 → 6.0.5
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/src/Author.vue +1 -4
- package/src/author/AuthorFollow.vue +50 -19
- package/src/single/cms-single.vue +13 -0
package/package.json
CHANGED
package/src/Author.vue
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
<div class="u-bio">{{ data.user_bio }}</div>
|
|
30
|
-
<AuthorFollow
|
|
30
|
+
<AuthorFollow class="u-follow-box" :uid="uid" />
|
|
31
31
|
<div class="u-link" v-if="hasLink">
|
|
32
32
|
<a v-if="data.weibo_name" class="u-weibo" :href="weiboLink(data.weibo_id)" target="_blank">
|
|
33
33
|
<img svg-inline src="../assets/img/author/weibo.svg" />
|
|
@@ -152,9 +152,6 @@ export default {
|
|
|
152
152
|
level: function() {
|
|
153
153
|
return User.getLevel(this.data?.experience);
|
|
154
154
|
},
|
|
155
|
-
isLogin: function() {
|
|
156
|
-
return User.isLogin();
|
|
157
|
-
},
|
|
158
155
|
},
|
|
159
156
|
methods: {
|
|
160
157
|
loadData: function() {
|
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="u-follow">
|
|
3
|
+
<!-- <template v-if="isLogin">
|
|
4
|
+
<template v-if="isSelf">
|
|
5
|
+
<div class="u-fans-box">
|
|
6
|
+
<span class="u-fans-label">关注</span>
|
|
7
|
+
<span class="u-fans">{{ formatFansNum(fansNum) }}</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-else>
|
|
11
|
+
|
|
12
|
+
</template>
|
|
13
|
+
</template>
|
|
14
|
+
<el-button class="u-fans-box" @click="follow" size="mini" v-else>
|
|
15
|
+
<span class="u-fans-label">关注</span>
|
|
16
|
+
<span class="u-fans">{{ formatFansNum(fansNum) }}</span>
|
|
17
|
+
</el-button> -->
|
|
3
18
|
<el-button
|
|
4
19
|
v-if="!isFollow"
|
|
5
|
-
:class="{ 'is-follow': isFollow }"
|
|
20
|
+
:class="{ 'is-follow': isFollow, 'u-fans-box': isSelf }"
|
|
6
21
|
size="mini"
|
|
7
|
-
:icon="btnIcon"
|
|
22
|
+
:icon="!isSelf && btnIcon"
|
|
8
23
|
@click="follow"
|
|
9
|
-
:
|
|
10
|
-
:type="btnType"
|
|
24
|
+
:type="isSelf ? '' : btnType"
|
|
11
25
|
:loading="loading"
|
|
26
|
+
:disabled="isSelf"
|
|
12
27
|
>
|
|
13
28
|
{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
|
|
14
29
|
</el-button>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</template>
|
|
30
|
+
<el-popover
|
|
31
|
+
v-else
|
|
32
|
+
placement="bottom"
|
|
33
|
+
trigger="hover"
|
|
34
|
+
popper-class="u-follow-popover"
|
|
35
|
+
:visible-arrow="false"
|
|
36
|
+
>
|
|
37
|
+
<div class="u-action-list">
|
|
38
|
+
<div class="u-action-item" v-for="item in actions" :key="item.label" @click.stop="item.action">{{ item.label }}</div>
|
|
39
|
+
</div>
|
|
40
|
+
<el-button class="u-unfollow-btn" size="mini" :type="btnType" slot="reference">{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span></el-button>
|
|
41
|
+
</el-popover>
|
|
28
42
|
<el-button size="mini" icon="el-icon-message" disabled title="Lv4+可用">私信</el-button>
|
|
29
43
|
</div>
|
|
30
44
|
</template>
|
|
@@ -73,6 +87,9 @@ export default {
|
|
|
73
87
|
user() {
|
|
74
88
|
return User.getInfo();
|
|
75
89
|
},
|
|
90
|
+
isLogin: function() {
|
|
91
|
+
return User.isLogin();
|
|
92
|
+
},
|
|
76
93
|
},
|
|
77
94
|
watch: {
|
|
78
95
|
uid: {
|
|
@@ -93,6 +110,10 @@ export default {
|
|
|
93
110
|
},
|
|
94
111
|
// 关注
|
|
95
112
|
follow() {
|
|
113
|
+
if (!this.isLogin) {
|
|
114
|
+
User.toLogin();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
96
117
|
follow(this.uid)
|
|
97
118
|
.then((res) => {
|
|
98
119
|
this.$message.success("关注成功");
|
|
@@ -153,7 +174,7 @@ export default {
|
|
|
153
174
|
.u-action-item {
|
|
154
175
|
text-align: center;
|
|
155
176
|
cursor: pointer;
|
|
156
|
-
padding:
|
|
177
|
+
padding: 8px 10px;
|
|
157
178
|
&:hover {
|
|
158
179
|
background: rgb(248,248,251);
|
|
159
180
|
}
|
|
@@ -162,7 +183,17 @@ export default {
|
|
|
162
183
|
}
|
|
163
184
|
}
|
|
164
185
|
.u-follow-count{
|
|
165
|
-
color:#fff;
|
|
166
186
|
margin-left:5px;
|
|
167
187
|
}
|
|
188
|
+
|
|
189
|
+
.u-fans-box {
|
|
190
|
+
cursor: default !important;
|
|
191
|
+
.u-fans-label {
|
|
192
|
+
color: #999;
|
|
193
|
+
margin-right: 5px;
|
|
194
|
+
}
|
|
195
|
+
.u-fans {
|
|
196
|
+
color: #333;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
168
199
|
</style>
|
|
@@ -59,6 +59,7 @@ import Article from "@jx3box/jx3box-editor/src/Article.vue";
|
|
|
59
59
|
import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
|
|
60
60
|
import Comment from "@jx3box/jx3box-comment-ui/src/Comment.vue";
|
|
61
61
|
import { __visibleMap } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
62
|
+
import { getAppType } from '@jx3box/jx3box-common/js/utils'
|
|
62
63
|
export default {
|
|
63
64
|
name: "cms-single",
|
|
64
65
|
components: {
|
|
@@ -85,6 +86,9 @@ export default {
|
|
|
85
86
|
id: function() {
|
|
86
87
|
return ~~this.post?.ID || 0;
|
|
87
88
|
},
|
|
89
|
+
app_type: function() {
|
|
90
|
+
return getAppType();
|
|
91
|
+
},
|
|
88
92
|
post_type: function() {
|
|
89
93
|
return this.post?.post_type;
|
|
90
94
|
},
|
|
@@ -157,6 +161,15 @@ export default {
|
|
|
157
161
|
handler : function (val){
|
|
158
162
|
this.$emit('extendUpdate',val)
|
|
159
163
|
}
|
|
164
|
+
},
|
|
165
|
+
post_type: {
|
|
166
|
+
deep : true,
|
|
167
|
+
immediate : true,
|
|
168
|
+
handler : function (val){
|
|
169
|
+
if (val && val !== this.app_type) {
|
|
170
|
+
location.href = `/${val}/${this.id}`
|
|
171
|
+
}
|
|
172
|
+
}
|
|
160
173
|
}
|
|
161
174
|
}
|
|
162
175
|
};
|