@jx3box/jx3box-common-ui 5.9.9 → 6.0.2

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.
@@ -179,6 +179,10 @@
179
179
  color:#f00;
180
180
  }
181
181
  }
182
+ .u-client{
183
+ margin-left:5px;
184
+ color:#09f;
185
+ }
182
186
  }
183
187
 
184
188
  @media screen and (max-width:@phone){
@@ -197,4 +201,4 @@
197
201
  .none;
198
202
  }
199
203
  }
200
- }
204
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.9.9",
3
+ "version": "6.0.2",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@jx3box/jx3box-comment-ui": "^1.7.0",
34
- "@jx3box/jx3box-common": "^7.3.5",
34
+ "@jx3box/jx3box-common": "^7.3.6",
35
35
  "@jx3box/jx3box-data": "^1.10.2",
36
- "@jx3box/jx3box-editor": "^1.4.2",
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",
@@ -1,34 +1,37 @@
1
1
  <template>
2
2
  <div class="u-follow">
3
3
  <el-button
4
+ v-if="!isFollow"
4
5
  :class="{ 'is-follow': isFollow }"
5
6
  size="mini"
6
7
  :icon="btnIcon"
7
8
  @click="follow"
9
+ :disabled="isSelf"
8
10
  :type="btnType"
9
- v-if="!isFollow"
10
11
  :loading="loading"
11
12
  >
12
13
  {{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
13
14
  </el-button>
14
- <el-popover
15
- v-else
16
- placement="bottom"
17
- trigger="hover"
18
- popper-class="u-follow-popover"
19
- :visible-arrow="false"
20
- >
21
- <div class="u-action-list">
22
- <div class="u-action-item" v-for="item in actions" :key="item.label" @click.stop="item.action">{{ item.label }}</div>
23
- </div>
24
- <el-button class="u-unfollow-btn" size="mini" :type="btnType" slot="reference">{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span></el-button>
25
- </el-popover>
15
+ <template v-else>
16
+ <el-popover
17
+ placement="bottom"
18
+ trigger="hover"
19
+ popper-class="u-follow-popover"
20
+ :visible-arrow="false"
21
+ >
22
+ <div class="u-action-list">
23
+ <div class="u-action-item" v-for="item in actions" :key="item.label" @click.stop="item.action">{{ item.label }}</div>
24
+ </div>
25
+ <el-button class="u-unfollow-btn" size="mini" :type="btnType" slot="reference">{{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span></el-button>
26
+ </el-popover>
27
+ </template>
26
28
  <el-button size="mini" icon="el-icon-message" disabled title="Lv4+可用">私信</el-button>
27
29
  </div>
28
30
  </template>
29
31
 
30
32
  <script>
31
- import { follow, unfollow, getMyFollowList, getFansCount } from "../../service/follow";
33
+ import { follow, unfollow, getFansCount } from "../../service/follow";
34
+ import User from "@jx3box/jx3box-common/js/user";
32
35
  export default {
33
36
  name: "AuthorFollow",
34
37
  props: {
@@ -49,7 +52,7 @@ export default {
49
52
  return this.isFollow ? "已关注" : "关注";
50
53
  },
51
54
  btnIcon() {
52
- return this.isFollow ? "" : "el-icon-plus";
55
+ return this.isSelf ? "" : (this.isFollow ? "" : "el-icon-plus");
53
56
  },
54
57
  btnType() {
55
58
  return this.isFollow ? "info" : "warning"
@@ -63,16 +66,27 @@ export default {
63
66
  },
64
67
  },
65
68
  ];
66
- }
69
+ },
70
+ isSelf() {
71
+ return this.uid == this.user.uid;
72
+ },
73
+ user() {
74
+ return User.getInfo();
75
+ },
67
76
  },
68
- mounted () {
69
- this.loadFans();
77
+ watch: {
78
+ uid: {
79
+ immediate: true,
80
+ handler(val) {
81
+ val && this.loadFans();
82
+ },
83
+ }
70
84
  },
71
85
  methods: {
72
86
  // 格式化粉丝数
73
87
  formatFansNum(num) {
74
88
  if (num < 10000) {
75
- return num;
89
+ return num === 0 ? "" : num;
76
90
  } else {
77
91
  return (num / 10000).toFixed(1) + "万";
78
92
  }
@@ -125,28 +139,30 @@ export default {
125
139
  </script>
126
140
 
127
141
  <style lang="less">
128
- .u-follow {
129
- }
130
142
  .u-unfollow-btn {
131
- margin-right: 10px;
143
+ &.el-button {
144
+ margin-right: 10px;
145
+ }
132
146
  }
133
147
  .u-follow-popover {
134
- min-width: 100px;
135
- padding: 0;
136
- margin: 0;
137
- .u-action-list {
138
- .u-action-item {
139
- text-align: center;
140
- cursor: pointer;
141
- padding: 12px 15px;
142
- &:hover {
143
- background: rgb(248,248,251);
148
+ &.el-popover {
149
+ min-width: 100px;
150
+ padding: 0;
151
+ margin: 0;
152
+ .u-action-list {
153
+ .u-action-item {
154
+ text-align: center;
155
+ cursor: pointer;
156
+ padding: 12px 15px;
157
+ &:hover {
158
+ background: rgb(248,248,251);
159
+ }
144
160
  }
145
161
  }
146
162
  }
147
163
  }
148
164
  .u-follow-count{
149
- color:#ffdea8;
165
+ color:#fff;
150
166
  margin-left:5px;
151
167
  }
152
168
  </style>
@@ -43,7 +43,8 @@
43
43
  </span>
44
44
  <span class="u-meta u-remark">{{item.remark}}</span>
45
45
  <time class="u-meta u-time">{{showTime(item.created_at)}}</time>
46
- <span class="u-delete" v-if="isSuperAdmin && !item.is_user_gift" @click="recovery(item,i)">
46
+ <span class="u-client" v-if="isSuperAdmin">{{item.client}}</span>
47
+ <span class="u-delete" v-if="isSuperAdmin" @click="recovery(item,i)">
47
48
  <i class="el-icon-delete"></i>撤销
48
49
  </span>
49
50
  </li>
@@ -89,7 +90,7 @@ export default {
89
90
  return {
90
91
  pageSize: this.per,
91
92
  pageIndex: this.page,
92
- client : this.postClient,
93
+ //client : this.postClient,
93
94
  };
94
95
  },
95
96
  },
@@ -4,7 +4,7 @@
4
4
  <boxcoin-admin :postId="postId" :postType="postType" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :max="admin_max" :min="admin_min" :own="admin_left" :total="admin_total" :points="admin_points" :authors="authors" @updateRecord="updateRecord" :client="client" />
5
5
  <Like :postId="postId" :postType="postType"></Like>
6
6
  <fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
7
- <boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left" :points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable" @updateRecord="updateRecord" />
7
+ <boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left" :points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable" @updateRecord="updateRecord" :client="client" />
8
8
  <Share :postId="postId" :postType="postType" :client="client" />
9
9
  </div>
10
10
  <div class="w-thx-records">