@jx3box/jx3box-common-ui 6.0.0 → 6.0.3

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": "6.0.0",
3
+ "version": "6.0.3",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,7 +31,7 @@
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
36
  "@jx3box/jx3box-editor": "^1.4.3",
37
37
  "axios": "^0.26.1",
package/src/Author.vue CHANGED
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </div>
29
29
  <div class="u-bio">{{ data.user_bio }}</div>
30
- <AuthorFollow v-if="isLogin" class="u-follow-box" :uid="uid" />
30
+ <AuthorFollow class="u-follow-box" :uid="uid" />
31
31
  <div class="u-link" v-if="hasLink">
32
32
  <a v-if="data.weibo_name" class="u-weibo" :href="weiboLink(data.weibo_id)" target="_blank">
33
33
  <img svg-inline src="../assets/img/author/weibo.svg" />
@@ -152,9 +152,6 @@ export default {
152
152
  level: function() {
153
153
  return User.getLevel(this.data?.experience);
154
154
  },
155
- isLogin: function() {
156
- return User.isLogin();
157
- },
158
155
  },
159
156
  methods: {
160
157
  loadData: function() {
@@ -1,34 +1,49 @@
1
1
  <template>
2
2
  <div class="u-follow">
3
- <el-button
4
- :class="{ 'is-follow': isFollow }"
5
- size="mini"
6
- :icon="btnIcon"
7
- @click="follow"
8
- :type="btnType"
9
- v-if="!isFollow"
10
- :loading="loading"
11
- >
12
- {{ btnText }}<span class="u-follow-count">{{ formatFansNum(fansNum) }}</span>
3
+ <template v-if="isLogin">
4
+ <template v-if="isSelf">
5
+ <div class="u-fans-box">
6
+ <span class="u-fans-label">粉丝数</span>
7
+ <span class="u-fans">{{ formatFansNum(fansNum) }}</span>
8
+ </div>
9
+ </template>
10
+ <template v-else>
11
+ <el-button
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>
35
+ </template>
36
+ </template>
37
+ <el-button class="u-fans-box" disabled size="mini" v-else>
38
+ <span class="u-fans-label">粉丝数</span>
39
+ <span class="u-fans">{{ formatFansNum(fansNum) }}</span>
13
40
  </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>
26
- <el-button size="mini" icon="el-icon-message" disabled title="Lv4+可用">私信</el-button>
27
41
  </div>
28
42
  </template>
29
43
 
30
44
  <script>
31
- import { follow, unfollow, getMyFollowList, getFansCount } from "../../service/follow";
45
+ import { follow, unfollow, getFansCount } from "../../service/follow";
46
+ import User from "@jx3box/jx3box-common/js/user";
32
47
  export default {
33
48
  name: "AuthorFollow",
34
49
  props: {
@@ -49,7 +64,7 @@ export default {
49
64
  return this.isFollow ? "已关注" : "关注";
50
65
  },
51
66
  btnIcon() {
52
- return this.isFollow ? "" : "el-icon-plus";
67
+ return this.isSelf ? "" : (this.isFollow ? "" : "el-icon-plus");
53
68
  },
54
69
  btnType() {
55
70
  return this.isFollow ? "info" : "warning"
@@ -63,16 +78,30 @@ export default {
63
78
  },
64
79
  },
65
80
  ];
66
- }
81
+ },
82
+ isSelf() {
83
+ return this.uid == this.user.uid;
84
+ },
85
+ user() {
86
+ return User.getInfo();
87
+ },
88
+ isLogin: function() {
89
+ return User.isLogin();
90
+ },
67
91
  },
68
- mounted () {
69
- this.loadFans();
92
+ watch: {
93
+ uid: {
94
+ immediate: true,
95
+ handler(val) {
96
+ val && this.loadFans();
97
+ },
98
+ }
70
99
  },
71
100
  methods: {
72
101
  // 格式化粉丝数
73
102
  formatFansNum(num) {
74
103
  if (num < 10000) {
75
- return num;
104
+ return num === 0 ? "" : num;
76
105
  } else {
77
106
  return (num / 10000).toFixed(1) + "万";
78
107
  }
@@ -151,4 +180,15 @@ export default {
151
180
  color:#fff;
152
181
  margin-left:5px;
153
182
  }
183
+
184
+ .u-fans-box {
185
+ cursor: default !important;
186
+ .u-fans-label {
187
+ color: #999;
188
+ margin-right: 5px;
189
+ }
190
+ .u-fans {
191
+ color: #333;
192
+ }
193
+ }
154
194
  </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">