@jx3box/jx3box-ui 2.2.0 → 2.2.2
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/CommonHeader.vue +37 -28
- package/src/bread/DesignTask.vue +5 -1
package/package.json
CHANGED
package/src/CommonHeader.vue
CHANGED
|
@@ -80,44 +80,53 @@ export default {
|
|
|
80
80
|
methods: {
|
|
81
81
|
// webView检测
|
|
82
82
|
checkIsWebView: function () {
|
|
83
|
-
|
|
84
|
-
document.documentElement.classList.add("env-app");
|
|
85
|
-
}
|
|
86
|
-
|
|
83
|
+
// 参数处理
|
|
87
84
|
const urlParams = new URLSearchParams(window.location.search);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
|
|
86
|
+
// 环境判断缓存
|
|
87
|
+
const isApp = checkIsApp();
|
|
88
|
+
const isMp = isMiniProgram();
|
|
89
|
+
|
|
90
|
+
// App 环境缓存
|
|
91
|
+
if (isApp) {
|
|
91
92
|
localStorage.setItem("__env", "app");
|
|
92
93
|
}
|
|
93
|
-
if (isMiniProgram() || checkIsApp()) {
|
|
94
|
-
const appid = urlParams.get("appid");
|
|
95
|
-
const item = miniprogram?.find((item) => item.appid === appid);
|
|
96
|
-
const from = urlParams.get("_from");
|
|
97
|
-
|
|
98
|
-
document.documentElement.classList.add("v-miniprogram");
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
// 小程序环境缓存
|
|
96
|
+
if (isMp) {
|
|
97
|
+
document.documentElement.classList.add("wechat-miniprogram");
|
|
98
|
+
window.JX3BOX_ENV = "MINIPROGRAM";
|
|
99
|
+
miniprogramHack();
|
|
100
|
+
}
|
|
103
101
|
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
// 来源参数缓存
|
|
103
|
+
const from = urlParams.get("from")?.replace(/[^a-zA-Z0-9_-]/g, "");
|
|
104
|
+
if (from) {
|
|
105
|
+
sessionStorage.setItem("from", from);
|
|
106
|
+
document.documentElement.classList.add("from-" + from);
|
|
107
|
+
}
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
// 如果来自推栏 App
|
|
110
|
+
if (sessionStorage.getItem("from") === "tl") {
|
|
111
|
+
document.documentElement.classList.add("v-miniprogram");
|
|
112
|
+
}
|
|
110
113
|
|
|
111
|
-
|
|
114
|
+
// 移动容器模式:包含小程序或 App 内嵌环境
|
|
115
|
+
if (isMp || isApp) {
|
|
116
|
+
document.documentElement.classList.add("v-miniprogram");
|
|
117
|
+
}
|
|
112
118
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
// 来自自身小程序
|
|
120
|
+
const appid = urlParams.get("appid");
|
|
121
|
+
const internalApp = miniprogram?.find((item) => item.appid === appid);
|
|
122
|
+
if (appid && internalApp) {
|
|
123
|
+
document.documentElement.classList.add("env-miniprogram-" + internalApp.id);
|
|
124
|
+
window.JX3BOX_ENV = internalApp.id?.toUpperCase() + "_MINIPROGRAM";
|
|
116
125
|
}
|
|
117
126
|
|
|
118
|
-
//
|
|
119
|
-
if (
|
|
120
|
-
document.documentElement.classList.add("
|
|
127
|
+
// 仅安卓有效,基本不使用
|
|
128
|
+
if (window.navigator.userAgent.includes(KW)) {
|
|
129
|
+
document.documentElement.classList.add("env-app");
|
|
121
130
|
}
|
|
122
131
|
},
|
|
123
132
|
|
package/src/bread/DesignTask.vue
CHANGED
|
@@ -139,6 +139,10 @@ export default {
|
|
|
139
139
|
if (["achievement", "item", "quest", "knowledge"].includes(this.post?.post_type)) {
|
|
140
140
|
this.form.type = "wiki";
|
|
141
141
|
}
|
|
142
|
+
// 当传入的 post 对象包含 subtype 字段时,优先使用 subtype 作为类型
|
|
143
|
+
if (this.post?.subtype) {
|
|
144
|
+
this.form.type = this.post.subtype;
|
|
145
|
+
}
|
|
142
146
|
}
|
|
143
147
|
this.loadLogs();
|
|
144
148
|
|
|
@@ -191,7 +195,7 @@ export default {
|
|
|
191
195
|
},
|
|
192
196
|
loadLogs() {
|
|
193
197
|
if (!this.post?.ID) return;
|
|
194
|
-
getDesignTask({ source_id: this.post?.ID }).then((res) => {
|
|
198
|
+
getDesignTask({ source_id: this.post?.ID, source_type: this.post?.post_type }).then((res) => {
|
|
195
199
|
this.logs = res.data.data || [];
|
|
196
200
|
});
|
|
197
201
|
},
|