@jx3box/jx3box-common-ui 5.7.10 → 5.7.13
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/App.vue +2 -2
- package/src/Author.vue +5 -2
- package/src/medal/medal.vue +46 -0
- package/service/next.js +0 -7
- package/src/medal/author_medal.vue +0 -64
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<LeftSidebar :open="true">
|
|
10
10
|
<LeftSideToggle :mobileOnly="true" />
|
|
11
|
-
<Author :author="author" :uid="
|
|
11
|
+
<Author :author="author" :uid="8" />
|
|
12
12
|
</LeftSidebar>
|
|
13
13
|
|
|
14
14
|
<Main :withoutLeft="false" :withoutRight="false">
|
|
@@ -147,7 +147,7 @@ import clientBy from "./filters/clientBy.vue";
|
|
|
147
147
|
import zlpBy from "./filters/zlpBy.vue";
|
|
148
148
|
|
|
149
149
|
import uploadImage from './upload/upload_banner.vue'
|
|
150
|
-
import AuthorMedal from './medal/
|
|
150
|
+
import AuthorMedal from './medal/medal.vue'
|
|
151
151
|
|
|
152
152
|
import WikiPanel from "./wiki/WikiPanel.vue";
|
|
153
153
|
import WikiRevisions from "./wiki/WikiRevisions.vue";
|
package/src/Author.vue
CHANGED
|
@@ -59,9 +59,10 @@
|
|
|
59
59
|
<span>作者荣誉</span>
|
|
60
60
|
</div>
|
|
61
61
|
<div class="u-medals" v-if="medals && medals.length">
|
|
62
|
-
<span class="u-medal" v-for="(item, i) in medals" :key="i">
|
|
62
|
+
<!-- <span class="u-medal" v-for="(item, i) in medals" :key="i">
|
|
63
63
|
<img :src="showMedalIcon(item.medal)" :title="showMedalDesc(item)" />
|
|
64
|
-
</span>
|
|
64
|
+
</span> -->
|
|
65
|
+
<medal :medals="medals" :showIcon="showMedalIcon"></medal>
|
|
65
66
|
</div>
|
|
66
67
|
</div>
|
|
67
68
|
<div class="u-teams" v-if="teams && teams.length">
|
|
@@ -88,6 +89,7 @@ import { getUserInfo, getDouyu, getUserMedals, getUserPublicTeams } from "../ser
|
|
|
88
89
|
import { user as medal_map } from "@jx3box/jx3box-common/data/medals.json";
|
|
89
90
|
import User from "@jx3box/jx3box-common/js/user";
|
|
90
91
|
import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
92
|
+
import medal from './medal/medal.vue'
|
|
91
93
|
export default {
|
|
92
94
|
name: "Author",
|
|
93
95
|
props: ["uid"],
|
|
@@ -213,6 +215,7 @@ export default {
|
|
|
213
215
|
components: {
|
|
214
216
|
Avatar,
|
|
215
217
|
Authorposts,
|
|
218
|
+
medal
|
|
216
219
|
},
|
|
217
220
|
};
|
|
218
221
|
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="m-medal">
|
|
3
|
+
<a :href="medalLink(item)" target="_blank" class="u-medal" v-for="item in medals" :key="item.id" :title="item.medal_desc">
|
|
4
|
+
<img class="u-medal-img" :src="showIcon(item.medal)" alt="">
|
|
5
|
+
</a>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { getMedalLink } from '@jx3box/jx3box-common/js/utils'
|
|
11
|
+
export default {
|
|
12
|
+
name: 'author_medal',
|
|
13
|
+
props: {
|
|
14
|
+
medals: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => [], // [{ rank_id, medal_desc, medal }]
|
|
17
|
+
},
|
|
18
|
+
showIcon: {
|
|
19
|
+
type: Function,
|
|
20
|
+
default: () => true,
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
|
|
25
|
+
medalLink({ rank_id, subtype }) {
|
|
26
|
+
return getMedalLink(rank_id, subtype)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="less">
|
|
33
|
+
.m-medal {
|
|
34
|
+
display: block;
|
|
35
|
+
margin: 5px 0;
|
|
36
|
+
|
|
37
|
+
.u-medal {
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
.u-medal-img {
|
|
40
|
+
width: 20px;
|
|
41
|
+
height: 20px;
|
|
42
|
+
margin-right: 5px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
package/service/next.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="m-medal">
|
|
3
|
-
<a :href="medalLink(item)" class="u-medal" v-for="item in medals" :key="item.id" :title="item.medal_desc">
|
|
4
|
-
<img class="u-medal-img" :src="medalImagePath(item.medal)" alt="">
|
|
5
|
-
</a>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import { getMedals } from '../../service/next'
|
|
11
|
-
import { __imgPath } from '@jx3box/jx3box-common/data/jx3box.json'
|
|
12
|
-
import { getMedalLink } from '@jx3box/jx3box-common/js/utils'
|
|
13
|
-
export default {
|
|
14
|
-
name: 'author_medal',
|
|
15
|
-
props: {
|
|
16
|
-
authorId: {
|
|
17
|
-
type: Number,
|
|
18
|
-
default: 0
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
data() {
|
|
22
|
-
return {
|
|
23
|
-
medals: [],
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
watch: {
|
|
27
|
-
authorId: {
|
|
28
|
-
immediate: true,
|
|
29
|
-
handler(val) {
|
|
30
|
-
val && this.loadAuthorMedal()
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
loadAuthorMedal() {
|
|
36
|
-
getMedals(this.authorId).then(res => {
|
|
37
|
-
this.medals = res.data.data
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
|
-
medalImagePath(medal) {
|
|
41
|
-
return `${__imgPath}image/medals/user/${medal}.gif`
|
|
42
|
-
},
|
|
43
|
-
medalLink({ rank_id, subtype }) {
|
|
44
|
-
return getMedalLink(rank_id, subtype)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<style lang="less" scoped>
|
|
51
|
-
.m-medal {
|
|
52
|
-
display: block;
|
|
53
|
-
margin: 5px 0;
|
|
54
|
-
|
|
55
|
-
.u-medal {
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
.u-medal-img {
|
|
58
|
-
width: 20px;
|
|
59
|
-
height: 20px;
|
|
60
|
-
margin-right: 5px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</style>
|