@jx3box/jx3box-common-ui 5.9.7 → 6.0.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.9.7",
3
+ "version": "6.0.0",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33,7 +33,7 @@
33
33
  "@jx3box/jx3box-comment-ui": "^1.7.0",
34
34
  "@jx3box/jx3box-common": "^7.3.5",
35
35
  "@jx3box/jx3box-data": "^1.10.2",
36
- "@jx3box/jx3box-editor": "^1.4.0",
36
+ "@jx3box/jx3box-editor": "^1.4.3",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
@@ -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
  },
@@ -139,28 +125,30 @@ export default {
139
125
  </script>
140
126
 
141
127
  <style lang="less">
142
- .u-follow {
143
- }
144
128
  .u-unfollow-btn {
145
- margin-right: 10px;
129
+ &.el-button {
130
+ margin-right: 10px;
131
+ }
146
132
  }
147
133
  .u-follow-popover {
148
- min-width: 100px;
149
- padding: 0;
150
- margin: 0;
151
- .u-action-list {
152
- .u-action-item {
153
- text-align: center;
154
- cursor: pointer;
155
- padding: 12px 15px;
156
- &:hover {
157
- background: rgb(248,248,251);
134
+ &.el-popover {
135
+ min-width: 100px;
136
+ padding: 0;
137
+ margin: 0;
138
+ .u-action-list {
139
+ .u-action-item {
140
+ text-align: center;
141
+ cursor: pointer;
142
+ padding: 12px 15px;
143
+ &:hover {
144
+ background: rgb(248,248,251);
145
+ }
158
146
  }
159
147
  }
160
148
  }
161
149
  }
162
150
  .u-follow-count{
163
- color:#ffdea8;
151
+ color:#fff;
164
152
  margin-left:5px;
165
153
  }
166
154
  </style>