From 69d16c85e3060f628cdce490e240bf77aa834bbb Mon Sep 17 00:00:00 2001 From: Phoenix <64720302+Concur-max@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:57:29 +0800 Subject: [PATCH] first --- .../dist/dev/app-plus/app-config-service.js | 4 +- unpackage/dist/dev/app-plus/app-service.js | 73 +++++++++++++++++++ unpackage/dist/dev/app-plus/manifest.json | 8 +- 3 files changed, 78 insertions(+), 7 deletions(-) diff --git a/unpackage/dist/dev/app-plus/app-config-service.js b/unpackage/dist/dev/app-plus/app-config-service.js index 6c1496c..fc25dbc 100644 --- a/unpackage/dist/dev/app-plus/app-config-service.js +++ b/unpackage/dist/dev/app-plus/app-config-service.js @@ -2,8 +2,8 @@ ;(function(){ let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[]; const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"oa考勤系统","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"4.15","entryPagePath":"pages/index/index","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{},"darkmode":false,"themeConfig":{}}; - const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"titleText":"uni-app","style":"custom","type":"default"},"isNVue":true}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute)); - __uniConfig.styles=[{}];//styles + const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"titleText":"uni-app","style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute)); + __uniConfig.styles=[];//styles __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:16})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:u,window:u,document:u,frames:u,self:u,location:u,navigator:u,localStorage:u,history:u,Caches:u,screen:u,alert:u,confirm:u,prompt:u,fetch:u,XMLHttpRequest:u,WebSocket:u,webkit:u,print:u}}}}); diff --git a/unpackage/dist/dev/app-plus/app-service.js b/unpackage/dist/dev/app-plus/app-service.js index 16b4c3e..98f8f65 100644 --- a/unpackage/dist/dev/app-plus/app-service.js +++ b/unpackage/dist/dev/app-plus/app-service.js @@ -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() { }, diff --git a/unpackage/dist/dev/app-plus/manifest.json b/unpackage/dist/dev/app-plus/manifest.json index 4c3dac1..1bf47c1 100644 --- a/unpackage/dist/dev/app-plus/manifest.json +++ b/unpackage/dist/dev/app-plus/manifest.json @@ -38,10 +38,7 @@ "launchwebview": { "render": "always", "id": "1", - "kernel": "WKWebview", - "uniNView": { - "path": "pages/index/index.js" - } + "kernel": "WKWebview" }, "usingComponents": true, "nvueStyleCompiler": "uni-app", @@ -172,5 +169,6 @@ "minUserAgentVersion": "49.0" } } - } + }, + "launch_path": "__uniappview.html" } \ No newline at end of file