youdas/unpackage/dist/dev/mp-weixin/pages/index/index.js
2025-06-20 18:11:38 +08:00

40 lines
1.5 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../common/system/routeMap.js");
require("../../common/platform/PlatformFactory.js");
const common_system_router = require("../../common/system/router.js");
const _sfc_main = {
__name: "index",
setup(__props) {
let icon = common_vendor.ref("/static/app-plus/icon_108.png");
let login_icon = common_vendor.ref("/static/app-plus/index_login.gif");
let tips_text = common_vendor.ref("正在加载中。。。");
common_vendor.onLoad(async () => {
const network = await common_vendor.index.getNetworkType();
if (network.networkType === "none") {
tips_text.value = "请检查网络连接";
common_vendor.index.onNetworkStatusChange(checkNetwork);
return;
}
common_system_router.navigateTo("/pages/news/news");
});
function checkNetwork(res) {
common_vendor.index.__f__("log", "at pages/index/index.vue:41", "网络状态变化:", res.isConnected, res.networkType);
if (res.isConnected) {
tips_text.value = "正在加载中。。。";
} else {
tips_text.value = "请检查网络连接";
}
}
return (_ctx, _cache) => {
return {
a: common_vendor.unref(icon),
b: common_vendor.unref(login_icon),
c: common_vendor.t(common_vendor.unref(tips_text))
};
};
}
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map