163 lines
6.4 KiB
JavaScript
163 lines
6.4 KiB
JavaScript
if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
|
|
Promise.prototype.finally = function(callback) {
|
|
const promise = this.constructor;
|
|
return this.then(
|
|
(value) => promise.resolve(callback()).then(() => value),
|
|
(reason) => promise.resolve(callback()).then(() => {
|
|
throw reason;
|
|
})
|
|
);
|
|
};
|
|
}
|
|
;
|
|
if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
|
|
const global = uni.requireGlobal();
|
|
ArrayBuffer = global.ArrayBuffer;
|
|
Int8Array = global.Int8Array;
|
|
Uint8Array = global.Uint8Array;
|
|
Uint8ClampedArray = global.Uint8ClampedArray;
|
|
Int16Array = global.Int16Array;
|
|
Uint16Array = global.Uint16Array;
|
|
Int32Array = global.Int32Array;
|
|
Uint32Array = global.Uint32Array;
|
|
Float32Array = global.Float32Array;
|
|
Float64Array = global.Float64Array;
|
|
BigInt64Array = global.BigInt64Array;
|
|
BigUint64Array = global.BigUint64Array;
|
|
}
|
|
;
|
|
if (uni.restoreGlobal) {
|
|
uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
|
|
}
|
|
(function(vue) {
|
|
"use strict";
|
|
function formatAppLog(type, filename, ...args) {
|
|
if (uni.__log__) {
|
|
uni.__log__(type, filename, ...args);
|
|
} else {
|
|
console[type].apply(console, [...args, filename]);
|
|
}
|
|
}
|
|
const _export_sfc = (sfc, props) => {
|
|
const target = sfc.__vccOpts || sfc;
|
|
for (const [key, val] of props) {
|
|
target[key] = val;
|
|
}
|
|
return target;
|
|
};
|
|
const _sfc_main$1 = {
|
|
data() {
|
|
return {
|
|
url: "",
|
|
originalUrl: "http://192.168.10.38:8080/#/login",
|
|
logMessages: []
|
|
// 用于收集日志
|
|
};
|
|
},
|
|
onLoad(options) {
|
|
this.addLog("🏠 home1页面开始加载");
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:18", "📄 home1 onLoad 执行", options);
|
|
this.initWebView();
|
|
},
|
|
onReady() {
|
|
this.addLog("✅ home1页面准备就绪");
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:23", "✅ home1 onReady 执行");
|
|
},
|
|
onShow() {
|
|
this.addLog("👀 home1页面显示");
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:27", "✅ home1 onShow 执行");
|
|
},
|
|
onHide() {
|
|
this.addLog("🔚 home1页面隐藏");
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:31", "🔚 home1 onHide 执行");
|
|
},
|
|
onUnload() {
|
|
this.addLog("🗑️ home1页面卸载");
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:35", "🗑️ home1 onUnload 执行");
|
|
},
|
|
onError(err) {
|
|
this.addLog("💥 home1页面错误: " + err);
|
|
formatAppLog("error", "at uni_modules/yykj-tv/pages/home/home1.vue:39", "💥 home1页面错误:", err);
|
|
},
|
|
methods: {
|
|
addLog(message) {
|
|
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
this.logMessages.push(`[${timestamp}] ${message}`);
|
|
formatAppLog("log", "at uni_modules/yykj-tv/pages/home/home1.vue:45", message);
|
|
},
|
|
initWebView() {
|
|
this.addLog("🌐 开始初始化WebView");
|
|
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
this.url = `${this.originalUrl}?timestamp=${timestamp}`;
|
|
this.addLog(`🔗 设置WebView URL: ${this.url}`);
|
|
uni.onNetworkStatusChange((res) => {
|
|
this.addLog(`📶 网络状态变化: ${res.isConnected ? "已连接" : "未连接"}`);
|
|
});
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return vue.openBlock(), vue.createElementBlock("view", null, [
|
|
vue.createElementVNode("web-view", { src: $data.url }, null, 8, ["src"])
|
|
]);
|
|
}
|
|
const Uni_modulesYykjTvPagesHomeHome1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "/Users/nuoli/Documents/2025work/git/tv-pro/uni_modules/yykj-tv/pages/home/home1.vue"]]);
|
|
__definePage("uni_modules/yykj-tv/pages/home/home1", Uni_modulesYykjTvPagesHomeHome1);
|
|
const _sfc_main = {
|
|
onLaunch: function(options) {
|
|
formatAppLog("log", "at App.vue:4", "🎯 App onLaunch 开始执行", (/* @__PURE__ */ new Date()).toISOString());
|
|
formatAppLog("log", "at App.vue:5", "📱 启动参数:", JSON.stringify(options));
|
|
formatAppLog("log", "at App.vue:6", "🔧 平台信息:", uni.getSystemInfoSync());
|
|
try {
|
|
formatAppLog("log", "at App.vue:10", "🔄 设置屏幕方向");
|
|
plus.screen.lockOrientation("landscape-primary");
|
|
plus.navigator.setFullscreen(true);
|
|
formatAppLog("log", "at App.vue:13", "✅ 屏幕方向设置成功");
|
|
} catch (e) {
|
|
formatAppLog("error", "at App.vue:15", "❌ 屏幕方向设置失败:", e);
|
|
}
|
|
uni.getNetworkType({
|
|
success: (res) => {
|
|
formatAppLog("log", "at App.vue:22", "📶 网络类型:", res.networkType);
|
|
},
|
|
fail: (err) => {
|
|
formatAppLog("error", "at App.vue:25", "❌ 获取网络状态失败:", err);
|
|
}
|
|
});
|
|
},
|
|
onShow: function(options) {
|
|
formatAppLog("log", "at App.vue:31", "👀 App onShow 执行", (/* @__PURE__ */ new Date()).toISOString());
|
|
formatAppLog("log", "at App.vue:32", "📱 显示参数:", JSON.stringify(options));
|
|
},
|
|
onError: function(error) {
|
|
formatAppLog("error", "at App.vue:36", "💥 App 全局错误:", error);
|
|
},
|
|
onPageNotFound: function(res) {
|
|
formatAppLog("error", "at App.vue:40", "❌ 页面未找到:", JSON.stringify(res));
|
|
},
|
|
onHide: function() {
|
|
formatAppLog("log", "at App.vue:44", "🔚 App Hide", (/* @__PURE__ */ new Date()).toISOString());
|
|
},
|
|
onUnload() {
|
|
formatAppLog("log", "at App.vue:47", "🗑️ App Unload", (/* @__PURE__ */ new Date()).toISOString());
|
|
}
|
|
};
|
|
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/nuoli/Documents/2025work/git/tv-pro/App.vue"]]);
|
|
function createApp() {
|
|
formatAppLog("log", "at main.js:23", "🚀 Vue3应用开始初始化", (/* @__PURE__ */ new Date()).toISOString());
|
|
const app = vue.createVueApp(App);
|
|
formatAppLog("log", "at main.js:25", "✅ Vue3应用实例创建完成", (/* @__PURE__ */ new Date()).toISOString());
|
|
return {
|
|
app
|
|
};
|
|
}
|
|
const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
|
|
uni.Vuex = __Vuex__;
|
|
uni.Pinia = __Pinia__;
|
|
__app__.provide("__globalStyles", __uniConfig.styles);
|
|
__app__._component.mpType = "app";
|
|
__app__._component.render = () => {
|
|
};
|
|
__app__.mount("#app");
|
|
})(Vue);
|