@jx3box/jx3box-common-ui 5.9.7 → 5.9.8
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 +6 -20
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@click="follow"
|
|
8
8
|
:type="btnType"
|
|
9
9
|
v-if="!isFollow"
|
|
10
|
+
:loading="loading"
|
|
10
11
|
>
|
|
11
12
|
{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
|
|
12
13
|
</el-button>
|
|
@@ -40,6 +41,7 @@ export default {
|
|
|
40
41
|
return {
|
|
41
42
|
isFollow: false,
|
|
42
43
|
fansNum: 0,
|
|
44
|
+
loading: false
|
|
43
45
|
};
|
|
44
46
|
},
|
|
45
47
|
computed: {
|
|
@@ -64,7 +66,6 @@ export default {
|
|
|
64
66
|
}
|
|
65
67
|
},
|
|
66
68
|
mounted () {
|
|
67
|
-
this.loadMyFollow();
|
|
68
69
|
this.loadFans();
|
|
69
70
|
},
|
|
70
71
|
methods: {
|
|
@@ -106,32 +107,17 @@ export default {
|
|
|
106
107
|
});
|
|
107
108
|
});
|
|
108
109
|
},
|
|
109
|
-
// 获取是否已关注
|
|
110
|
-
loadMyFollow() {
|
|
111
|
-
const params = {
|
|
112
|
-
pageIndex: 1,
|
|
113
|
-
pageSize: 10,
|
|
114
|
-
user_id: this.uid,
|
|
115
|
-
};
|
|
116
|
-
getMyFollowList(params)
|
|
117
|
-
.then((res) => {
|
|
118
|
-
if (res.data.data.list.length > 0) {
|
|
119
|
-
this.isFollow = true;
|
|
120
|
-
} else {
|
|
121
|
-
this.isFollow = false;
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
.catch((err) => {
|
|
125
|
-
console.log(err);
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
110
|
loadFans() {
|
|
111
|
+
this.loading = true;
|
|
129
112
|
getFansCount(this.uid)
|
|
130
113
|
.then((res) => {
|
|
131
114
|
this.fansNum = res.data.data.follower_count || 0;
|
|
115
|
+
this.isFollow = res.data.data.is_followed;
|
|
132
116
|
})
|
|
133
117
|
.catch((err) => {
|
|
134
118
|
console.log(err);
|
|
119
|
+
}).finally(() => {
|
|
120
|
+
this.loading = false;
|
|
135
121
|
});
|
|
136
122
|
}
|
|
137
123
|
},
|