@maoyugames/phaser-framework 1.0.7 → 1.0.10
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/dist/cli/index.js +14 -2
- package/dist/platform/tiktok.js +14 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -475,8 +475,20 @@ function renderTikTokHtml(cfg, scriptSrc) {
|
|
|
475
475
|
const initTag = sdkUrl ? `<script>
|
|
476
476
|
window.TTMinis = TTMinis;
|
|
477
477
|
TTMinis.game.init({ clientKey: "${escapeAttr(clientKey)}" });
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
(function () {
|
|
479
|
+
function report(p) {
|
|
480
|
+
try {
|
|
481
|
+
TTMinis.game.setLoadingProgress({
|
|
482
|
+
progress: p,
|
|
483
|
+
fail: function (e) { console.warn('[setLoadingProgress fail]', e && e.error); },
|
|
484
|
+
});
|
|
485
|
+
} catch (e) { console.warn('[setLoadingProgress throw]', e); }
|
|
486
|
+
}
|
|
487
|
+
// \u5F02\u6B65\u89E6\u53D1,\u8BA9 SDK \u7684 De \u901A\u9053\u6709\u4E00\u62CD\u65F6\u95F4\u5C31\u7EEA
|
|
488
|
+
setTimeout(function () { report(0.3); }, 0);
|
|
489
|
+
document.addEventListener('DOMContentLoaded', function () { report(0.7); });
|
|
490
|
+
window.addEventListener('load', function () { report(1); });
|
|
491
|
+
})();
|
|
480
492
|
</script>` : "";
|
|
481
493
|
return `<!doctype html>
|
|
482
494
|
<html lang="en">
|
package/dist/platform/tiktok.js
CHANGED
|
@@ -71,13 +71,23 @@ var TikTokPayment = class {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
var TikTokDevice = class {
|
|
74
|
+
// 注:TikTok H5 minigame SDK 实测(2026-05-27)**完全没有** vibrateShort/vibrateLong
|
|
75
|
+
// 方法(navigator.vibrate 也被禁,SDK 内部只 console.error 替换)。业务高频调用
|
|
76
|
+
// (如棋盘 tap 反馈)如果不做存在性检测会持续 throw TypeError 打断游戏流程。
|
|
77
|
+
// 这里 typeof 检测后静默 noop——震动不是关键能力,SDK 没有就算了。
|
|
74
78
|
vibrateShort() {
|
|
75
|
-
if (!hasTT()) return;
|
|
76
|
-
|
|
79
|
+
if (!hasTT() || typeof TTMinis.game.vibrateShort !== "function") return;
|
|
80
|
+
try {
|
|
81
|
+
TTMinis.game.vibrateShort();
|
|
82
|
+
} catch {
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
vibrateLong() {
|
|
79
|
-
if (!hasTT()) return;
|
|
80
|
-
|
|
86
|
+
if (!hasTT() || typeof TTMinis.game.vibrateLong !== "function") return;
|
|
87
|
+
try {
|
|
88
|
+
TTMinis.game.vibrateLong();
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
async setClipboard(text) {
|
|
83
93
|
requireTT("device.setClipboard");
|