@jx3box/jx3box-common-ui 8.2.5 → 8.2.6
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/service/author.js +7 -1
- package/service/cms.js +1 -5
- package/src/App.vue +2 -2
- package/src/author/AuthorHonor.vue +49 -51
package/package.json
CHANGED
package/service/author.js
CHANGED
|
@@ -64,6 +64,11 @@ function getUserHonors(uid) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
function getUserHonor(uid) {
|
|
68
|
+
return $cms({ mute: true })
|
|
69
|
+
.get(`/api/cms/user/honor/${uid}/using`)
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
function getFrames() {
|
|
68
73
|
return axios.get(__imgPath + "avatar/index.json");
|
|
69
74
|
}
|
|
@@ -102,5 +107,6 @@ export {
|
|
|
102
107
|
userSignIn,
|
|
103
108
|
getFansList,
|
|
104
109
|
getUserInfoByUidOrName,
|
|
105
|
-
getUserHonors
|
|
110
|
+
getUserHonors,
|
|
111
|
+
getUserHonor
|
|
106
112
|
};
|
package/service/cms.js
CHANGED
|
@@ -18,10 +18,6 @@ function getDecorationJson() {
|
|
|
18
18
|
let url = __imgPath + "decoration/index.json";
|
|
19
19
|
return axios.get(url);
|
|
20
20
|
}
|
|
21
|
-
function getHonorJson() {
|
|
22
|
-
let url = __imgPath + "decoration/honor.json";
|
|
23
|
-
return axios.get(url);
|
|
24
|
-
}
|
|
25
21
|
// 通用上传
|
|
26
22
|
function upload(formData) {
|
|
27
23
|
return $cms().post(`/api/cms/upload`, formData);
|
|
@@ -77,5 +73,5 @@ function setUserMeta(key,data) {
|
|
|
77
73
|
return $cms().post(`/api/cms/user/my/meta?key=${key}`, data);
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson,
|
|
76
|
+
export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember,
|
|
81
77
|
getSliders, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
|
package/src/App.vue
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
bread info
|
|
16
16
|
</Breadcrumb>
|
|
17
17
|
|
|
18
|
-
<LeftSidebar :open="true" :uid="
|
|
18
|
+
<LeftSidebar :open="true" :uid="8719">
|
|
19
19
|
<LeftSideToggle :mobileOnly="true" />
|
|
20
|
-
<Author :author="author" :uid="
|
|
20
|
+
<Author :author="author" :uid="8719" />
|
|
21
21
|
</LeftSidebar>
|
|
22
22
|
|
|
23
23
|
<Main :withoutLeft="false" :withoutRight="false">
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
<script>
|
|
7
7
|
import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
8
|
-
import {
|
|
9
|
-
import { getUserHonors } from "../../service/author";
|
|
8
|
+
import { getUserHonor } from "../../service/author";
|
|
10
9
|
import { inRange } from "lodash";
|
|
11
10
|
const HONOR_IMG_KEY = "honor_img";
|
|
12
11
|
export default {
|
|
@@ -47,69 +46,68 @@ export default {
|
|
|
47
46
|
try {
|
|
48
47
|
this.honor = JSON.parse(honor_local);
|
|
49
48
|
} catch (err) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
49
|
+
getUserHonor(user_id).then((res) => {
|
|
50
|
+
this.honor = res.data.data;
|
|
51
|
+
if (!this.honor) {
|
|
53
52
|
//空 则为无主题,不再加载接口,界面设No
|
|
54
53
|
sessionStorage.setItem(HONOR_IMG_KEY + user_id, "no");
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
this.getHonorStyle(honor);
|
|
56
|
+
this.getHonorStyle(this.honor);
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
},
|
|
62
60
|
//有称号后,获取样式配置
|
|
63
61
|
getHonorStyle(honor) {
|
|
64
|
-
const data = honor
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} else {
|
|
77
|
-
honorStr = honorStr + prefix;
|
|
78
|
-
}
|
|
62
|
+
const data = honor
|
|
63
|
+
let honorConfig = honor?.honor_info;
|
|
64
|
+
let only = honorConfig.only;
|
|
65
|
+
let prefix = honorConfig.prefix;
|
|
66
|
+
let regPrefix = honorConfig.prefix.match(/\{([^{}]+?)\}/g);
|
|
67
|
+
let ranking = honorConfig.ranking;
|
|
68
|
+
let honorStr = honorConfig.year || "";
|
|
69
|
+
|
|
70
|
+
console.log(honorConfig, regPrefix)
|
|
71
|
+
if (!only) {
|
|
72
|
+
if (regPrefix) {
|
|
73
|
+
honorStr = honorStr + (data[regPrefix[0].slice(1, -1)] || "");
|
|
79
74
|
} else {
|
|
80
|
-
honorStr = prefix;
|
|
75
|
+
honorStr = honorStr + prefix;
|
|
81
76
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
77
|
+
} else {
|
|
78
|
+
honorStr = prefix;
|
|
79
|
+
}
|
|
80
|
+
if (ranking.length > 0) {
|
|
81
|
+
data.imgIndex = 0;
|
|
82
|
+
for (let i = 0; i < ranking.length; i++) {
|
|
83
|
+
if (
|
|
84
|
+
honor.ranking !== undefined &&
|
|
85
|
+
inRange(Number(honor.ranking), ranking[i][0], ranking[i][1])
|
|
86
|
+
) {
|
|
87
|
+
data.imgIndex = i;
|
|
88
|
+
let str = ranking[i][2];
|
|
89
|
+
let regStr = str.match(/\{([^{}]+?)\}/g);
|
|
90
|
+
if (regStr) {
|
|
91
|
+
honorStr =
|
|
92
|
+
honorStr +
|
|
93
|
+
str.replace(/\{([^{}]+?)\}/g, function (match, p1) {
|
|
94
|
+
return data[p1] || "";
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
honorStr = honorStr + str;
|
|
102
98
|
}
|
|
99
|
+
break;
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
}
|
|
103
|
+
data.honor = honorStr + honorConfig.suffix;
|
|
104
|
+
data.color = honorConfig.color;
|
|
105
|
+
data.img = honorConfig.img;
|
|
106
|
+
data.img_ext = honorConfig.img_ext;
|
|
107
|
+
data.isHave = true;
|
|
108
|
+
data.isImgIndex = ranking.length > 0;
|
|
109
|
+
sessionStorage.setItem(HONOR_IMG_KEY + this.uid, JSON.stringify(data));
|
|
110
|
+
this.honor = data;
|
|
113
111
|
},
|
|
114
112
|
},
|
|
115
113
|
};
|