@jx3box/jx3box-common-ui 6.0.3 → 6.0.4
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/AuthorFollow.vue +35 -30
package/package.json
CHANGED
|
@@ -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
|
|