|
|
|
@ -31,6 +31,24 @@ if (uni.restoreGlobal) {
|
|
|
|
|
}
|
|
|
|
|
(function(vue) {
|
|
|
|
|
"use strict";
|
|
|
|
|
const env = "dev";
|
|
|
|
|
const configs = {
|
|
|
|
|
dev: {
|
|
|
|
|
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
|
|
|
|
|
h5Url: "http://192.168.88.37:8080/#/"
|
|
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
|
|
|
|
|
h5Url: "http://172.16.100.93:8041/#/"
|
|
|
|
|
},
|
|
|
|
|
prod: {
|
|
|
|
|
apiBaseUrl: "https://oa-a.szjixun.cn/api",
|
|
|
|
|
h5Url: "https://oa-a.szjixun.cn/#/"
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const config = configs[env];
|
|
|
|
|
const ON_SHOW = "onShow";
|
|
|
|
|
const ON_HIDE = "onHide";
|
|
|
|
|
function formatAppLog(type, filename, ...args) {
|
|
|
|
|
if (uni.__log__) {
|
|
|
|
|
uni.__log__(type, filename, ...args);
|
|
|
|
@ -38,6 +56,11 @@ if (uni.restoreGlobal) {
|
|
|
|
|
console[type].apply(console, [...args, filename]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
|
|
|
|
|
!vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
|
|
|
|
|
};
|
|
|
|
|
const onShow = /* @__PURE__ */ createHook(ON_SHOW);
|
|
|
|
|
const onHide = /* @__PURE__ */ createHook(ON_HIDE);
|
|
|
|
|
const _export_sfc = (sfc, props) => {
|
|
|
|
|
const target = sfc.__vccOpts || sfc;
|
|
|
|
|
for (const [key, val] of props) {
|
|
|
|
@ -45,6 +68,56 @@ if (uni.restoreGlobal) {
|
|
|
|
|
}
|
|
|
|
|
return target;
|
|
|
|
|
};
|
|
|
|
|
const _sfc_main$1 = {
|
|
|
|
|
__name: "index",
|
|
|
|
|
setup(__props) {
|
|
|
|
|
const networkStatusChange = (res) => {
|
|
|
|
|
if (res.isConnected) {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: "/pages/index/index"
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "网络无连接",
|
|
|
|
|
icon: "none"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const webViewObj = vue.ref(null);
|
|
|
|
|
onShow(() => {
|
|
|
|
|
uni.onNetworkStatusChange(networkStatusChange);
|
|
|
|
|
});
|
|
|
|
|
onHide(() => {
|
|
|
|
|
uni.offNetworkStatusChange(networkStatusChange);
|
|
|
|
|
});
|
|
|
|
|
const webLoad = (e2) => {
|
|
|
|
|
var _a, _b;
|
|
|
|
|
const h5SendString = (_b = (_a = e2.detail.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.action;
|
|
|
|
|
switch (h5SendString) {
|
|
|
|
|
case "load-complete": {
|
|
|
|
|
const { statusBarHeight } = uni.getSystemInfoSync();
|
|
|
|
|
const currentWebview = getCurrentPages().pop().$getAppWebview();
|
|
|
|
|
webViewObj.value = currentWebview.children()[0];
|
|
|
|
|
webViewObj.value.setStyle({
|
|
|
|
|
top: statusBarHeight,
|
|
|
|
|
bottom: 0
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return (_ctx, _cache) => {
|
|
|
|
|
return vue.openBlock(), vue.createElementBlock("web-view", {
|
|
|
|
|
class: "webview",
|
|
|
|
|
onMessage: webLoad,
|
|
|
|
|
style: { "flex": "1" },
|
|
|
|
|
ref: "webViewRef",
|
|
|
|
|
src: vue.unref(config).h5Url
|
|
|
|
|
}, null, 40, ["src"]);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/WebstormProjects/oa-base/pages/index/index.vue"]]);
|
|
|
|
|
__definePage("pages/index/index", PagesIndexIndex);
|
|
|
|
|
const _sfc_main = {
|
|
|
|
|
onLaunch: function() {
|
|
|
|
|
},
|
|
|
|
|