@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.7.10",
3
+ "version": "5.7.11",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
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/author_medal.vue'
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
- authorId: {
17
- type: Number,
18
- default: 0
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/user/${medal}.gif`
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)
package/service/next.js DELETED
@@ -1,7 +0,0 @@
1
- import { $next } from "@jx3box/jx3box-common/js/https";
2
-
3
- function getMedals(author){
4
- return $next({ mute: true }).get(`api/user/${author}/medals`);
5
- }
6
-
7
- export { getMedals };