@jx3box/jx3box-common-ui 5.5.17 → 5.5.21
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/assets/css/author.less +2 -2
- package/index.js +2 -0
- package/package.json +3 -3
- package/service/author.js +1 -1
- package/src/App.vue +16 -1
- package/src/Author.vue +12 -15
- package/src/author/Avatar.vue +55 -39
- package/src/interact/boxcoin_records.vue +1 -1
- package/src/wiki/WikiRevisions.vue +2 -2
package/assets/css/author.less
CHANGED
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import Breadcrumb from './src/Breadcrumb.vue'
|
|
|
5
5
|
import LeftSidebar from './src/LeftSidebar.vue'
|
|
6
6
|
import LeftSideToggle from './src/LeftSideToggle.vue'
|
|
7
7
|
import Author from './src/Author.vue'
|
|
8
|
+
import Avatar from './src/author/Avatar.vue'
|
|
8
9
|
import RightSidebar from './src/RightSidebar.vue'
|
|
9
10
|
import RightSideMsg from './src/RightSideMsg.vue'
|
|
10
11
|
import Main from './src/Main.vue'
|
|
@@ -44,6 +45,7 @@ const components = {
|
|
|
44
45
|
|
|
45
46
|
RightSideMsg,
|
|
46
47
|
Author,
|
|
48
|
+
Avatar,
|
|
47
49
|
|
|
48
50
|
Thx,
|
|
49
51
|
Like,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.21",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"last 2 versions"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@jx3box/jx3box-comment-ui": "^1.6.
|
|
34
|
-
"@jx3box/jx3box-common": "^7.0.
|
|
33
|
+
"@jx3box/jx3box-comment-ui": "^1.6.8",
|
|
34
|
+
"@jx3box/jx3box-common": "^7.0.18",
|
|
35
35
|
"@jx3box/jx3box-data": "^1.8.3",
|
|
36
36
|
"@jx3box/jx3box-editor": "^1.2.4",
|
|
37
37
|
"axios": "^0.19.2",
|
package/service/author.js
CHANGED
package/src/App.vue
CHANGED
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
|
|
14
14
|
<Main :withoutLeft="false" :withoutRight="false">
|
|
15
15
|
<el-tabs v-model="tab" type="card">
|
|
16
|
+
<el-tab-pane label="头像" name="avatar">
|
|
17
|
+
<el-radio-group v-model="avatar_size">
|
|
18
|
+
<el-radio :label="60">xs-60</el-radio>
|
|
19
|
+
<el-radio :label="84">s-84</el-radio>
|
|
20
|
+
<el-radio :label="136">m-136</el-radio>
|
|
21
|
+
<el-radio :label="224">l-224</el-radio>
|
|
22
|
+
</el-radio-group>
|
|
23
|
+
<div>
|
|
24
|
+
<Avatar :size="avatar_size" url="" :id="8" frame="" />
|
|
25
|
+
</div>
|
|
26
|
+
</el-tab-pane>
|
|
16
27
|
<el-tab-pane label="CMS作品" name="post">
|
|
17
28
|
<el-radio-group v-model="post_id">
|
|
18
29
|
<el-radio label="35605">Markdown</el-radio>
|
|
@@ -96,6 +107,7 @@ import Breadcrumb from "./Breadcrumb.vue";
|
|
|
96
107
|
import LeftSidebar from "./LeftSidebar.vue";
|
|
97
108
|
import LeftSideToggle from "./LeftSideToggle.vue";
|
|
98
109
|
import Author from "./Author.vue";
|
|
110
|
+
import Avatar from "./author/Avatar.vue";
|
|
99
111
|
import UserPop from "./author/UserPop.vue";
|
|
100
112
|
|
|
101
113
|
import Main from "./Main.vue";
|
|
@@ -161,6 +173,7 @@ export default {
|
|
|
161
173
|
|
|
162
174
|
RightSideMsg,
|
|
163
175
|
Author,
|
|
176
|
+
Avatar,
|
|
164
177
|
// Authorposts,
|
|
165
178
|
|
|
166
179
|
Mark,
|
|
@@ -188,7 +201,7 @@ export default {
|
|
|
188
201
|
},
|
|
189
202
|
data: function() {
|
|
190
203
|
return {
|
|
191
|
-
tab: "
|
|
204
|
+
tab: "avatar",
|
|
192
205
|
|
|
193
206
|
post: "",
|
|
194
207
|
post_id: "35605",
|
|
@@ -197,6 +210,8 @@ export default {
|
|
|
197
210
|
wikiPost: null,
|
|
198
211
|
tag: "",
|
|
199
212
|
visible: false,
|
|
213
|
+
|
|
214
|
+
avatar_size : 60,
|
|
200
215
|
};
|
|
201
216
|
},
|
|
202
217
|
created: function() {
|
package/src/Author.vue
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<div class="u-author">
|
|
4
4
|
<Avatar
|
|
5
5
|
class="u-avatar"
|
|
6
|
-
:
|
|
6
|
+
:uid="uid"
|
|
7
7
|
:url="data.user_avatar"
|
|
8
8
|
:size="68"
|
|
9
9
|
:frame="data.user_avatar_frame"
|
|
10
10
|
/>
|
|
11
|
-
<a class="u-name" :href="authorLink(
|
|
11
|
+
<a class="u-name" :href="authorLink(uid)">
|
|
12
12
|
<span>{{ data.display_name }}</span>
|
|
13
13
|
</a>
|
|
14
14
|
<el-tooltip
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
<span>所属团队</span>
|
|
89
89
|
</div>
|
|
90
90
|
<a class="u-team" v-for="(item,i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
|
|
91
|
-
<img class="u-
|
|
92
|
-
<span class="u-
|
|
91
|
+
<img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
|
|
92
|
+
<span class="u-team-name">{{item.team_name}}@{{item.team_server}}</span>
|
|
93
93
|
</a>
|
|
94
94
|
</div>
|
|
95
95
|
<Authorposts :uid="uid" />
|
|
@@ -139,9 +139,6 @@ export default {
|
|
|
139
139
|
};
|
|
140
140
|
},
|
|
141
141
|
computed: {
|
|
142
|
-
id: function () {
|
|
143
|
-
return this.uid;
|
|
144
|
-
},
|
|
145
142
|
tv_type: function () {
|
|
146
143
|
return this.data && this.data.tv_type;
|
|
147
144
|
},
|
|
@@ -180,7 +177,7 @@ export default {
|
|
|
180
177
|
},
|
|
181
178
|
methods: {
|
|
182
179
|
loadData: function () {
|
|
183
|
-
return getUserInfo(this.
|
|
180
|
+
return getUserInfo(this.uid)
|
|
184
181
|
.then((data) => {
|
|
185
182
|
this.data = data;
|
|
186
183
|
})
|
|
@@ -200,12 +197,12 @@ export default {
|
|
|
200
197
|
}
|
|
201
198
|
},
|
|
202
199
|
loadMedals: function () {
|
|
203
|
-
getUserMedals(this.
|
|
200
|
+
getUserMedals(this.uid).then((data) => {
|
|
204
201
|
this.medals = data;
|
|
205
202
|
});
|
|
206
203
|
},
|
|
207
204
|
loadTeams: function () {
|
|
208
|
-
getUserPublicTeams(this.
|
|
205
|
+
getUserPublicTeams(this.uid).then((data) => {
|
|
209
206
|
this.teams = data && data.slice(0, 5);
|
|
210
207
|
});
|
|
211
208
|
},
|
|
@@ -214,12 +211,12 @@ export default {
|
|
|
214
211
|
this.isVIP = await User.isVIP();
|
|
215
212
|
},
|
|
216
213
|
checkSuperAuthor: function () {
|
|
217
|
-
getSuperAuthor(this.
|
|
214
|
+
getSuperAuthor(this.uid).then((res) => {
|
|
218
215
|
this.isSuperAuthor = res.data.data;
|
|
219
216
|
});
|
|
220
217
|
},
|
|
221
218
|
loadIdentity: function () {
|
|
222
|
-
getIdentity(this.
|
|
219
|
+
getIdentity(this.uid).then((res) => {
|
|
223
220
|
this.isPRO = res.data.data.isPRO;
|
|
224
221
|
this.isVIP = res.data.data.isPRE;
|
|
225
222
|
});
|
|
@@ -239,8 +236,8 @@ export default {
|
|
|
239
236
|
githubLink: function (val) {
|
|
240
237
|
return "https://github.com/" + val;
|
|
241
238
|
},
|
|
242
|
-
teamLink: function (
|
|
243
|
-
return getLink("org",
|
|
239
|
+
teamLink: function (team_id) {
|
|
240
|
+
return getLink("org", team_id);
|
|
244
241
|
},
|
|
245
242
|
showTeamLogo: function (val) {
|
|
246
243
|
return getThumbnail(val, 32);
|
|
@@ -252,7 +249,7 @@ export default {
|
|
|
252
249
|
},
|
|
253
250
|
},
|
|
254
251
|
mounted: function () {
|
|
255
|
-
this.
|
|
252
|
+
this.uid && this.loadData();
|
|
256
253
|
},
|
|
257
254
|
components: {
|
|
258
255
|
Avatar,
|
package/src/author/Avatar.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a class="c-avatar" :href="authorLink(uid)">
|
|
3
|
-
<img :src="showAvatar(
|
|
3
|
+
<img :src="showAvatar(url)" class="c-avatar-pic" :class="{ isCircle }" />
|
|
4
4
|
<i class="c-avatar-frame" v-if="frameName" :class="style">
|
|
5
5
|
<img :src="frameUrl" />
|
|
6
6
|
</i>
|
|
@@ -9,71 +9,87 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
import
|
|
12
|
+
import default_frames from "@jx3box/jx3box-common/data/user_avatar_frame.json";
|
|
13
13
|
import { __server, __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
14
14
|
import { getFrames } from "../../service/author";
|
|
15
15
|
import { showAvatar, authorLink } from "@jx3box/jx3box-common/js/utils";
|
|
16
16
|
export default {
|
|
17
|
-
name: "",
|
|
18
|
-
props: ["
|
|
17
|
+
name: "Avatar",
|
|
18
|
+
props: ["uid", "url", "size", "frame"],
|
|
19
19
|
components: {},
|
|
20
|
-
data: function
|
|
20
|
+
data: function() {
|
|
21
21
|
return {
|
|
22
|
-
frames,
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
frames: [],
|
|
23
|
+
styles : [
|
|
24
|
+
{cls:'xs',size:60},
|
|
25
|
+
{cls:'s',size:84},
|
|
26
|
+
{cls:'m',size:136},
|
|
27
|
+
{cls:'l',size:224},
|
|
28
|
+
]
|
|
25
29
|
};
|
|
26
30
|
},
|
|
27
31
|
computed: {
|
|
28
|
-
|
|
29
|
-
return ~~this.id || 0;
|
|
30
|
-
},
|
|
31
|
-
avatar: function () {
|
|
32
|
-
return this.url;
|
|
33
|
-
},
|
|
34
|
-
frameName: function () {
|
|
32
|
+
frameName: function() {
|
|
35
33
|
return this.frame && this.frames[this.frame] ? this.frame : "";
|
|
36
34
|
},
|
|
37
|
-
frameUrl: function
|
|
35
|
+
frameUrl: function() {
|
|
38
36
|
if (this.frameName) {
|
|
39
|
-
let fileName = this.frames[this.frameName].files[this.style]
|
|
40
|
-
|
|
41
|
-
return __imgPath + `image/avatar/${this.frameName}/${fileName}`;
|
|
37
|
+
let fileName = this.frames[this.frameName].files[this.style].file;
|
|
38
|
+
return __imgPath + `avatar/images/${this.frameName}/${fileName}`;
|
|
42
39
|
}
|
|
43
40
|
return "";
|
|
44
41
|
},
|
|
45
|
-
isCircle: function
|
|
46
|
-
return
|
|
47
|
-
this.frameName && this.frames[this.frameName].style == "circle"
|
|
48
|
-
);
|
|
42
|
+
isCircle: function() {
|
|
43
|
+
return this.frameName && this.frames[this.frameName].style == "circle";
|
|
49
44
|
},
|
|
50
|
-
style: function
|
|
45
|
+
style: function() {
|
|
51
46
|
let style = ~~this.size;
|
|
52
|
-
this.
|
|
53
|
-
if
|
|
54
|
-
return this.
|
|
47
|
+
for(let [i,v] of this.styles.entries()){
|
|
48
|
+
if(style < v.size){
|
|
49
|
+
return this.styles[i]['cls']
|
|
55
50
|
}
|
|
56
|
-
}
|
|
51
|
+
}
|
|
57
52
|
return "s";
|
|
58
53
|
},
|
|
54
|
+
data: function() {
|
|
55
|
+
return [this.uid, this.url, this.size, this.frame];
|
|
56
|
+
},
|
|
59
57
|
},
|
|
60
58
|
methods: {
|
|
61
|
-
loadFrames: function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
loadFrames: function() {
|
|
60
|
+
|
|
61
|
+
// 无头像框
|
|
62
|
+
if(!this.frame) return
|
|
63
|
+
|
|
64
|
+
let frames = sessionStorage.getItem("avatarFrames");
|
|
65
|
+
|
|
66
|
+
// 本地缓存
|
|
67
|
+
if(frames){
|
|
68
|
+
try {
|
|
69
|
+
frames = JSON.parse(frames);
|
|
70
|
+
this.frames = frames;
|
|
71
|
+
} catch (e) {
|
|
72
|
+
this.frames = default_frames
|
|
65
73
|
}
|
|
66
|
-
|
|
74
|
+
|
|
75
|
+
// 线上数据
|
|
76
|
+
}else{
|
|
77
|
+
getFrames().then((res) => {
|
|
78
|
+
if (res.data) {
|
|
79
|
+
this.frames = res.data || {};
|
|
80
|
+
sessionStorage.setItem("avatarFrames", JSON.stringify(this.frames));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
67
84
|
},
|
|
68
|
-
showAvatar: function
|
|
85
|
+
showAvatar: function(val) {
|
|
69
86
|
return showAvatar(val, this.size);
|
|
70
87
|
},
|
|
71
88
|
authorLink,
|
|
72
89
|
},
|
|
73
|
-
|
|
74
|
-
this.loadFrames()
|
|
75
|
-
}
|
|
76
|
-
mounted: function () {},
|
|
90
|
+
mounted : function (){
|
|
91
|
+
this.loadFrames()
|
|
92
|
+
}
|
|
77
93
|
};
|
|
78
94
|
</script>
|
|
79
95
|
|
|
@@ -125,4 +141,4 @@ export default {
|
|
|
125
141
|
top: -22px;
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
|
-
</style>
|
|
144
|
+
</style>
|
|
@@ -50,11 +50,11 @@ export default {
|
|
|
50
50
|
},
|
|
51
51
|
computed: {
|
|
52
52
|
baseUrl: function() {
|
|
53
|
-
return location.href.includes("classic") ? __OriginRoot : __Root;
|
|
53
|
+
return (location.href.includes("classic") || location.href.includes("origin")) ? __OriginRoot : __Root;
|
|
54
54
|
},
|
|
55
55
|
prefix: function() {
|
|
56
56
|
if (this.isGame) {
|
|
57
|
-
return this.baseUrl;
|
|
57
|
+
return this.baseUrl.slice(0,-1);
|
|
58
58
|
} else {
|
|
59
59
|
return "";
|
|
60
60
|
}
|