From 86cb4aafa8df426e65eb93a5daf36aaece6609c7 Mon Sep 17 00:00:00 2001 From: Phoenix <64720302+Concur-max@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:54:16 +0800 Subject: [PATCH] first --- .../dist/dev/app-plus/app-config-service.js | 2 +- unpackage/dist/dev/app-plus/app-service.js | 124 +----------------- unpackage/dist/dev/app-plus/manifest.json | 2 +- 3 files changed, 8 insertions(+), 120 deletions(-) diff --git a/unpackage/dist/dev/app-plus/app-config-service.js b/unpackage/dist/dev/app-plus/app-config-service.js index dd69d50..d9e2c2d 100644 --- a/unpackage/dist/dev/app-plus/app-config-service.js +++ b/unpackage/dist/dev/app-plus/app-config-service.js @@ -1,7 +1,7 @@ ;(function(){ let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[]; - const __uniConfig = {"pages":[],"globalStyle":{"navigationBar":{},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"泰丰考勤","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 __uniConfig = {"pages":[],"globalStyle":{"navigationBar":{},"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,"titleNView":false,"navigationBar":{"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()})}}); diff --git a/unpackage/dist/dev/app-plus/app-service.js b/unpackage/dist/dev/app-plus/app-service.js index 5890db9..fa6a917 100644 --- a/unpackage/dist/dev/app-plus/app-service.js +++ b/unpackage/dist/dev/app-plus/app-service.js @@ -63,98 +63,6 @@ if (uni.restoreGlobal) { const onShow = /* @__PURE__ */ createHook(ON_SHOW); const onHide = /* @__PURE__ */ createHook(ON_HIDE); const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH); - const receiveWebView = (e2) => { - return e2.detail.data[0]; - }; - const location$1 = { - // 检测是否开启系统定位权限 - hasLocationPermission() { - const system = uni.getSystemInfoSync(); - if (system.platform === "android") { - return this.checkAndroidLocationPermission(); - } else if (system.platform === "ios") { - return this.checkiOSLocationPermission(); - } - return false; - }, - // 检查安卓系统定位权限 - checkAndroidLocationPermission() { - const context = plus.android.importClass("android.content.Context"); - const locationManager = plus.android.importClass("android.location.LocationManager"); - const main = plus.android.runtimeMainActivity(); - const service = main.getSystemService(context.LOCATION_SERVICE); - if (service.isProviderEnabled(locationManager.GPS_PROVIDER)) { - return true; - } else { - this.showLocationServiceModal("请开启位置服务功能", this.openAndroidLocationSettings); - return false; - } - }, - // 检查iOS系统定位权限 - checkiOSLocationPermission() { - const CLLocationManager = plus.ios.import("CLLocationManager"); - const enabled = CLLocationManager.locationServicesEnabled(); - const status = CLLocationManager.authorizationStatus(); - plus.ios.deleteObject(CLLocationManager); - if (enabled && status !== 2) { - return true; - } else { - this.showLocationServiceModal("请前往设置-定位服务打开定位服务功能", this.openiOSLocationSettings); - return false; - } - }, - // 提示用户启用位置服务 - showLocationServiceModal(content, openSettingsCallback) { - uni.showModal({ - title: "友情提示", - content, - success: (e2) => { - if (e2.confirm) { - openSettingsCallback(); - } - } - }); - }, - // 打开安卓定位设置页面 - openAndroidLocationSettings() { - const Intent = plus.android.importClass("android.content.Intent"); - const Settings = plus.android.importClass("android.provider.Settings"); - const main = plus.android.runtimeMainActivity(); - const intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); - main.startActivity(intent); - }, - // 打开iOS定位设置页面 - openiOSLocationSettings() { - const UIApplication = plus.ios.import("UIApplication"); - const application = UIApplication.sharedApplication(); - const NSURL = plus.ios.import("NSURL"); - const setting = NSURL.URLWithString("app-settings:"); - application.openURL(setting); - plus.ios.deleteObject(setting); - plus.ios.deleteObject(NSURL); - plus.ios.deleteObject(application); - }, - // 开启后台持续获取定位功能 - startLocationService(successCallBack = () => { - }, failCallBack = () => { - }, options) { - if (this.hasLocationPermission()) { - plus.geolocation.watchPosition( - (position) => successCallBack(position), - (error) => { - formatAppLog("log", "at utils/location.js:85", "定位失败", error); - failCallBack(error); - }, - options - ); - } - }, - // 关闭定位功能 - closeLocationService(locationWatcherId) { - plus.geolocation.clearWatch(locationWatcherId); - } - }; - uni; const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { @@ -165,8 +73,6 @@ if (uni.restoreGlobal) { const _sfc_main$1 = { __name: "index", setup(__props) { - const webViewRef = vue.ref(null); - const systemInfo = uni.getSystemInfoSync(); const networkStatusChange = (res) => { if (res.isConnected) { uni.redirectTo({ @@ -180,40 +86,23 @@ if (uni.restoreGlobal) { } }; const webViewObj = vue.ref(null); - const handleBackButton = () => { - }; - let LocationId = null; onShow(() => { - plus.key.addEventListener("backbutton", handleBackButton, false); uni.onNetworkStatusChange(networkStatusChange); }); onHide(() => { - plus.geolocation.clearWatch(LocationId); - plus.key.removeEventListener("backbutton", handleBackButton, false); uni.offNetworkStatusChange(networkStatusChange); }); const webLoad = (e2) => { - const m2 = receiveWebView(e2); - switch (m2.action) { + 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]; - let statusBarHeight = uni.getSystemInfoSync().statusBarHeight; webViewObj.value.setStyle({ - //设置web-view距离顶部的距离以及自己的高度,单位为px top: statusBarHeight, - //此处是距离顶部的高度,应该是你页面的头部 bottom: 0 - //webview的高度 - }); - LocationId = location$1.startLocationService((res) => { - const jsonString = JSON.stringify({ ...res, systemInfo }); - webViewObj.value.evalJS(`window.onReceive(${jsonString})`); - }, () => { - }, { - geocode: true, - coordsType: "gcj02", - enableHighAccuracy: true }); } } @@ -223,8 +112,7 @@ if (uni.restoreGlobal) { class: "webview", onMessage: webLoad, style: { "flex": "1" }, - ref_key: "webViewRef", - ref: webViewRef, + ref: "webViewRef", src: vue.unref(config).h5Url }, null, 40, ["src"]); }; @@ -558,7 +446,7 @@ if (uni.restoreGlobal) { const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), P = b, T = I('{\n "address": [\n "127.0.0.1",\n "192.168.56.1",\n "192.168.88.37"\n ],\n "debugPort": 9000,\n "initialLaunchType": "local",\n "servePort": 7000,\n "skipFiles": [\n "/**",\n "C:/Users/37363/Downloads/HBuilderX.4.08.2024040127/HBuilderX/plugins/unicloud/**/*.js"\n ]\n}\n'), C = I('[{"provider":"aliyun","spaceName":"oabase","spaceId":"mp-edf38b0d-bc9a-4e81-9a15-f55995ccca70","clientSecret":"ty1X79FB2pMuAQUzaQBKXA==","endpoint":"https://api.next.bspapp.com"}]') || []; let O = ""; try { - O = "__UNI__4796942"; + O = "__UNI__70C49A3"; } catch (e2) { } let E = {}; diff --git a/unpackage/dist/dev/app-plus/manifest.json b/unpackage/dist/dev/app-plus/manifest.json index 5bbe35b..8ff9c7e 100644 --- a/unpackage/dist/dev/app-plus/manifest.json +++ b/unpackage/dist/dev/app-plus/manifest.json @@ -46,7 +46,7 @@ "statusbar": { "immersed": "supportedDevice", "style": "dark", - "background": "#000000" + "background": "#F8F8F8" }, "navigationbar": { "hidden": true