@jx3box/jx3box-editor 3.2.7 → 3.2.8
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/components/Author.vue +16 -10
package/package.json
CHANGED
|
@@ -91,6 +91,8 @@ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
|
91
91
|
import Avatar from "./Avatar.vue";
|
|
92
92
|
const ATCARD_CACHE_KEY = "skin_atcard_pc_authorcard_v2_";
|
|
93
93
|
const ATCARD_SUBTYPE = "pc_authorcard";
|
|
94
|
+
const DEFAULT_ATCARD_IMAGE = "https://cdn.jx3box.com/design/skin/default/pc_authorcard.png";
|
|
95
|
+
const DEFAULT_ATCARD_POSITION = "right top";
|
|
94
96
|
const DECORATION_JSON = "decoration_json";
|
|
95
97
|
const DECORATION_KEY = "decoration_me";
|
|
96
98
|
const HONOR_KEY = "honor_me";
|
|
@@ -132,8 +134,8 @@ export default {
|
|
|
132
134
|
data: null,
|
|
133
135
|
medals: [],
|
|
134
136
|
loading: false,
|
|
135
|
-
bg:
|
|
136
|
-
bgPosition:
|
|
137
|
+
bg: DEFAULT_ATCARD_IMAGE,
|
|
138
|
+
bgPosition: DEFAULT_ATCARD_POSITION,
|
|
137
139
|
honor: "",
|
|
138
140
|
honorStyle: {},
|
|
139
141
|
}),
|
|
@@ -215,8 +217,7 @@ export default {
|
|
|
215
217
|
},
|
|
216
218
|
getAtcard() {
|
|
217
219
|
const uid = this.uid;
|
|
218
|
-
this.
|
|
219
|
-
this.bgPosition = "right top";
|
|
220
|
+
this.setAtcardBackground();
|
|
220
221
|
|
|
221
222
|
const cached = this.getAtcardCache(uid);
|
|
222
223
|
if (cached) {
|
|
@@ -236,7 +237,7 @@ export default {
|
|
|
236
237
|
let image = this.showDecorationImage(skin?.image);
|
|
237
238
|
if (!image) {
|
|
238
239
|
this.setAtcardCache(uid, "no");
|
|
239
|
-
this.
|
|
240
|
+
this.setAtcardBackground();
|
|
240
241
|
return;
|
|
241
242
|
}
|
|
242
243
|
let payload = {
|
|
@@ -248,18 +249,23 @@ export default {
|
|
|
248
249
|
})
|
|
249
250
|
.catch(() => {
|
|
250
251
|
if (this.uid === uid) {
|
|
251
|
-
this.
|
|
252
|
+
this.setAtcardBackground();
|
|
252
253
|
}
|
|
253
254
|
});
|
|
254
255
|
},
|
|
255
|
-
setAtcardBackground(val) {
|
|
256
|
+
setAtcardBackground(val = null) {
|
|
257
|
+
if (!val) {
|
|
258
|
+
this.bg = DEFAULT_ATCARD_IMAGE;
|
|
259
|
+
this.bgPosition = DEFAULT_ATCARD_POSITION;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
256
262
|
if (typeof val === "string") {
|
|
257
263
|
this.bg = val || "";
|
|
258
|
-
this.bgPosition =
|
|
264
|
+
this.bgPosition = DEFAULT_ATCARD_POSITION;
|
|
259
265
|
return;
|
|
260
266
|
}
|
|
261
|
-
this.bg = val?.image ||
|
|
262
|
-
this.bgPosition = val?.position ||
|
|
267
|
+
this.bg = val?.image || DEFAULT_ATCARD_IMAGE;
|
|
268
|
+
this.bgPosition = val?.position || DEFAULT_ATCARD_POSITION;
|
|
263
269
|
},
|
|
264
270
|
getAtcardCache(uid) {
|
|
265
271
|
let cached = sessionStorage.getItem(ATCARD_CACHE_KEY + uid);
|