@jx3box/jx3box-common-ui 5.7.10 → 5.7.11
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 +1 -1
- package/src/medal/{author_medal.vue → medal.vue} +12 -16
- package/service/next.js +0 -7
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -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";
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-medal">
|
|
3
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="">
|
|
4
|
+
<img class="u-medal-img" :onerror="`this.src=${errorPath}`" :src="medalImagePath(item.medal)" alt="">
|
|
5
5
|
</a>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
-
import { getMedals } from '../../service/next'
|
|
11
10
|
import { __imgPath } from '@jx3box/jx3box-common/data/jx3box.json'
|
|
12
11
|
import { getMedalLink } from '@jx3box/jx3box-common/js/utils'
|
|
13
12
|
export default {
|
|
14
13
|
name: 'author_medal',
|
|
15
14
|
props: {
|
|
16
|
-
|
|
17
|
-
type:
|
|
18
|
-
default:
|
|
15
|
+
medals: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => [], // [{ id, medal_desc, medal }]
|
|
18
|
+
},
|
|
19
|
+
subtype: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '', // team, user
|
|
19
22
|
},
|
|
20
|
-
},
|
|
21
|
-
data() {
|
|
22
|
-
return {
|
|
23
|
-
medals: [],
|
|
24
|
-
}
|
|
25
23
|
},
|
|
26
24
|
watch: {
|
|
27
25
|
authorId: {
|
|
@@ -32,13 +30,11 @@ export default {
|
|
|
32
30
|
}
|
|
33
31
|
},
|
|
34
32
|
methods: {
|
|
35
|
-
loadAuthorMedal() {
|
|
36
|
-
getMedals(this.authorId).then(res => {
|
|
37
|
-
this.medals = res.data.data
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
33
|
medalImagePath(medal) {
|
|
41
|
-
return `${__imgPath}image/medals
|
|
34
|
+
return `${__imgPath}image/medals/${this.subtype}/${medal}.gif`
|
|
35
|
+
},
|
|
36
|
+
errorPath(medal) {
|
|
37
|
+
return `${__imgPath}image/medals/${this.subtype}/${medal}.png`
|
|
42
38
|
},
|
|
43
39
|
medalLink({ rank_id, subtype }) {
|
|
44
40
|
return getMedalLink(rank_id, subtype)
|