@jx3box/jx3box-common-ui 6.0.3 → 6.0.6
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/Breadcrumb.vue +1 -6
- package/src/author/AuthorFollow.vue +35 -30
- package/src/single/cms-single.vue +13 -0
package/package.json
CHANGED
package/src/Breadcrumb.vue
CHANGED
|
@@ -77,12 +77,7 @@ export default {
|
|
|
77
77
|
data: function () {
|
|
78
78
|
return {
|
|
79
79
|
isOpen: true,
|
|
80
|
-
feedback:
|
|
81
|
-
feedback +
|
|
82
|
-
"&subject=" +
|
|
83
|
-
location.href +
|
|
84
|
-
"?uid=" +
|
|
85
|
-
User.getInfo().uid,
|
|
80
|
+
feedback: '/feedback?refer=' + encodeURIComponent(window.location.href),
|
|
86
81
|
isNotAdmin: !User.isEditor(),
|
|
87
82
|
isOverlay: false,
|
|
88
83
|
isApp: isApp(),
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="u-follow">
|
|
3
|
-
<template v-if="isLogin">
|
|
3
|
+
<!-- <template v-if="isLogin">
|
|
4
4
|
<template v-if="isSelf">
|
|
5
5
|
<div class="u-fans-box">
|
|
6
|
-
<span class="u-fans-label"
|
|
6
|
+
<span class="u-fans-label">关注</span>
|
|
7
7
|
<span class="u-fans">{{ formatFansNum(fansNum) }}</span>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
<template v-else>
|
|
11
|
-
|
|
12
|
-
v-if="!isFollow"
|
|
13
|
-
:class="{ 'is-follow': isFollow }"
|
|
14
|
-
size="mini"
|
|
15
|
-
:icon="btnIcon"
|
|
16
|
-
@click="follow"
|
|
17
|
-
:type="btnType"
|
|
18
|
-
:loading="loading"
|
|
19
|
-
>
|
|
20
|
-
{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
|
|
21
|
-
</el-button>
|
|
22
|
-
<el-popover
|
|
23
|
-
v-else
|
|
24
|
-
placement="bottom"
|
|
25
|
-
trigger="hover"
|
|
26
|
-
popper-class="u-follow-popover"
|
|
27
|
-
:visible-arrow="false"
|
|
28
|
-
>
|
|
29
|
-
<div class="u-action-list">
|
|
30
|
-
<div class="u-action-item" v-for="item in actions" :key="item.label" @click.stop="item.action">{{ item.label }}</div>
|
|
31
|
-
</div>
|
|
32
|
-
<el-button class="u-unfollow-btn" size="mini" :type="btnType" slot="reference">{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span></el-button>
|
|
33
|
-
</el-popover>
|
|
34
|
-
<el-button size="mini" icon="el-icon-message" disabled title="Lv4+可用">私信</el-button>
|
|
11
|
+
|
|
35
12
|
</template>
|
|
36
13
|
</template>
|
|
37
|
-
<el-button class="u-fans-box"
|
|
38
|
-
<span class="u-fans-label"
|
|
14
|
+
<el-button class="u-fans-box" @click="follow" size="mini" v-else>
|
|
15
|
+
<span class="u-fans-label">关注</span>
|
|
39
16
|
<span class="u-fans">{{ formatFansNum(fansNum) }}</span>
|
|
17
|
+
</el-button> -->
|
|
18
|
+
<el-button
|
|
19
|
+
v-if="!isFollow"
|
|
20
|
+
:class="{ 'is-follow': isFollow, 'u-fans-box': isSelf }"
|
|
21
|
+
size="mini"
|
|
22
|
+
:icon="!isSelf && btnIcon"
|
|
23
|
+
@click="follow"
|
|
24
|
+
:type="isSelf ? '' : btnType"
|
|
25
|
+
:loading="loading"
|
|
26
|
+
:disabled="isSelf"
|
|
27
|
+
>
|
|
28
|
+
{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
|
|
40
29
|
</el-button>
|
|
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>
|
|
42
|
+
<el-button size="mini" icon="el-icon-message" disabled title="Lv4+可用">私信</el-button>
|
|
41
43
|
</div>
|
|
42
44
|
</template>
|
|
43
45
|
|
|
@@ -108,6 +110,10 @@ export default {
|
|
|
108
110
|
},
|
|
109
111
|
// 关注
|
|
110
112
|
follow() {
|
|
113
|
+
if (!this.isLogin) {
|
|
114
|
+
User.toLogin();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
111
117
|
follow(this.uid)
|
|
112
118
|
.then((res) => {
|
|
113
119
|
this.$message.success("关注成功");
|
|
@@ -168,7 +174,7 @@ export default {
|
|
|
168
174
|
.u-action-item {
|
|
169
175
|
text-align: center;
|
|
170
176
|
cursor: pointer;
|
|
171
|
-
padding:
|
|
177
|
+
padding: 8px 10px;
|
|
172
178
|
&:hover {
|
|
173
179
|
background: rgb(248,248,251);
|
|
174
180
|
}
|
|
@@ -177,7 +183,6 @@ export default {
|
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
.u-follow-count{
|
|
180
|
-
color:#fff;
|
|
181
186
|
margin-left:5px;
|
|
182
187
|
}
|
|
183
188
|
|
|
@@ -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
|
};
|