outside-the-system
Phoenix 3 months ago
parent 1245e825e3
commit 2d70c64db5

@ -19,10 +19,10 @@ onShow(() => {
})
onHide(() => {
plus.geolocation.clearWatch(LocationId)
/* plus.geolocation.clearWatch(LocationId) */
console.log("App Hide")
})
uni.getPushClientId({
/* uni.getPushClientId({
success: (res) => {
let push_clientid = res.cid
console.log('客户端推送标识cid:',push_clientid)
@ -30,7 +30,7 @@ uni.getPushClientId({
fail(err) {
console.log(err)
}
})
}) */
uni.onPushMessage((res)=>{
console.log(JSON.stringify(res),);
})

@ -2,7 +2,7 @@ const env = 'dev';
const configs = {
dev: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
h5Url: 'http://192.168.88.49:8080/#/'
h5Url: 'http://192.168.88.37:8080/#/'
},
test: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',

@ -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":"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 __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 __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()})}});

File diff suppressed because one or more lines are too long

@ -5,10 +5,10 @@
"iPad"
],
"id": "__UNI__4796942",
"name": "oa考勤系统",
"name": "泰丰考勤",
"version": {
"name": "1.1.7",
"code": 117
"name": "1.0.0",
"code": 100
},
"description": "",
"developer": {
@ -19,7 +19,6 @@
"permissions": {
"Camera": {},
"Geolocation": {},
"Push": {},
"UniNView": {
"description": "UniNView原生渲染"
}
@ -148,14 +147,7 @@
"UniversalLinks": ""
}
},
"push": {
"unipush": {
"version": "2",
"offline": true,
"hms": {},
"vivo": {}
}
},
"push": {},
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
@ -163,22 +155,7 @@
}
}
},
"nativePlugins": {
"KJ-WebView": {
"__plugin_info__": {
"name": "官方WebView全能扩展、支持plus、vue、nvue里的WebView - [试用版,仅用于自定义调试基座]",
"description": "WebView与原生双向通信交互、传值、js注入、设置获取UserAgent(桌面网站)、原生侧滑返回 、媒体播放自动播放、请试用合适再购买、请试用合适再购买、请试用合适再购买",
"platforms": "Android,iOS",
"url": "https://ext.dcloud.net.cn/plugin?id=9832",
"android_package_name": "",
"ios_bundle_id": "",
"isCloud": true,
"bought": 0,
"pid": "9832",
"parameters": {}
}
}
},
"nativePlugins": {},
"uniStatistics": {
"enable": false
},

@ -31,29 +31,11 @@ if (uni.restoreGlobal) {
}
(function(vue) {
"use strict";
const ON_SHOW = "onShow";
const ON_HIDE = "onHide";
const ON_LAUNCH = "onLaunch";
const ON_LOAD = "onLoad";
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
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 onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
const env = "dev";
const configs = {
dev: {
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
h5Url: "http://192.168.88.49:8080/#/"
h5Url: "http://192.168.88.37:8080/#/"
},
test: {
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
@ -65,101 +47,109 @@ if (uni.restoreGlobal) {
}
};
const config = configs[env];
const sendWebWiew = (refValue, paramValue, callName = "onReceive") => {
if (!refValue) {
formatAppLog("error", "at utils/communicate/index.js:3", "evalJs: The reference to the webview is not provided or is null.");
return;
}
formatAppLog("log", "at utils/communicate/index.js:6", "测试", refValue.evalJs);
if (typeof refValue.evalJs !== "function") {
formatAppLog("error", "at utils/communicate/index.js:8", "evalJs: The evalJs method is not available on the provided reference.");
return;
}
try {
const jsonString = JSON.stringify(paramValue);
const jsCode = `window.${callName}(${jsonString})`;
refValue.evalJs(jsCode);
} catch (error) {
formatAppLog("error", "at utils/communicate/index.js:18", "evalJs: An error occurred while trying to stringify the parameter value or while invoking evalJs.", error);
const ON_SHOW = "onShow";
const ON_HIDE = "onHide";
const ON_LAUNCH = "onLaunch";
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
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 onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
const receiveWebView = (e2) => {
return e2.detail.data[0];
};
const location$1 = {
//检测是否开启系统定位权限
// 检测是否开启系统定位权限
hasLocationPermission() {
let system = uni.getSystemInfoSync();
const system = uni.getSystemInfoSync();
if (system.platform === "android") {
let context = plus.android.importClass("android.content.Context");
let locationManager = plus.android.importClass("android.location.LocationManager");
let main = plus.android.runtimeMainActivity();
let service = main.getSystemService(context.LOCATION_SERVICE);
if (service.isProviderEnabled(locationManager.GPS_PROVIDER))
return true;
else {
uni.showModal({
title: "友情提示",
content: "请开启位置服务功能",
success: (e2) => {
if (e2.confirm) {
let Intent = plus.android.importClass("android.content.Intent");
let Settings = plus.android.importClass("android.provider.Settings");
let intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
main.startActivity(intent);
}
}
});
}
return this.checkAndroidLocationPermission();
} else if (system.platform === "ios") {
let cllocationManger = plus.ios.import("CLLocationManager");
let enable = cllocationManger.locationServicesEnabled();
let status = cllocationManger.authorizationStatus();
plus.ios.deleteObject(cllocationManger);
if (enable && status != 2)
return true;
else {
uni.showModal({
title: "友情提示",
content: "请前往设置-定位服务打开定位服务功能",
success: (e2) => {
if (e2.confirm) {
let UIApplication = plus.ios.import("UIApplication");
let application = UIApplication.sharedApplication();
let NSURL = plus.ios.import("NSURL");
let setting = NSURL.URLWithString("app-settings:");
application.openURL(setting);
plus.ios.deleteObject(setting);
plus.ios.deleteObject(NSURL);
plus.ios.deleteObject(application);
}
}
});
}
return this.checkiOSLocationPermission();
}
return false;
},
/**
* successCallBack:成功回调函数
*failCallBack:失败回调函数
*maximumAge获取定位间隔时间
*/
// 检查安卓系统定位权限
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()) {
let locationWatcherId = plus.geolocation.watchPosition((position) => {
successCallBack({
locationWatcherId,
position: position.coords
});
}, function(e2) {
formatAppLog("log", "at utils/location.js:68", e2, "定位失败");
failCallBack(e2);
}, options);
plus.geolocation.watchPosition(
(position) => successCallBack(position),
(error) => {
formatAppLog("log", "at utils/location.js:85", "定位失败", error);
failCallBack(error);
},
options
);
}
},
//关闭定位功能
// 关闭定位功能
closeLocationService(locationWatcherId) {
plus.geolocation.clearWatch(locationWatcherId);
}
@ -176,7 +166,7 @@ if (uni.restoreGlobal) {
__name: "index",
setup(__props) {
const webViewRef = vue.ref(null);
uni.getSystemInfoSync();
const systemInfo = uni.getSystemInfoSync();
const networkStatusChange = (res) => {
if (res.isConnected) {
uni.redirectTo({
@ -190,18 +180,15 @@ if (uni.restoreGlobal) {
}
};
const webViewObj = vue.ref(null);
onLoad(() => {
});
const handleBackButton = () => {
sendWebWiew(webViewObj.value, { turnBack: 1 });
};
let LocationId2 = null;
let LocationId = null;
onShow(() => {
plus.key.addEventListener("backbutton", handleBackButton, false);
uni.onNetworkStatusChange(networkStatusChange);
});
onHide(() => {
plus.geolocation.clearWatch(LocationId2);
plus.geolocation.clearWatch(LocationId);
plus.key.removeEventListener("backbutton", handleBackButton, false);
uni.offNetworkStatusChange(networkStatusChange);
});
@ -219,10 +206,8 @@ if (uni.restoreGlobal) {
bottom: 0
//webview的高度
});
const systemInfo = uni.getSystemInfoSync();
LocationId2 = location$1.startLocationService((res) => {
const jsonString = JSON.stringify({ ...res.position, systemInfo });
formatAppLog("log", "at pages/index/index.vue:96", "测试", jsonString);
LocationId = location$1.startLocationService((res) => {
const jsonString = JSON.stringify({ ...res, systemInfo });
webViewObj.value.evalJS(`window.onReceive(${jsonString})`);
}, () => {
}, {
@ -255,18 +240,8 @@ if (uni.restoreGlobal) {
onShow(() => {
});
onHide(() => {
plus.geolocation.clearWatch(LocationId);
formatAppLog("log", "at App.vue:23", "App Hide");
});
uni.getPushClientId({
success: (res) => {
let push_clientid = res.cid;
formatAppLog("log", "at App.vue:28", "客户端推送标识cid:", push_clientid);
},
fail(err) {
formatAppLog("log", "at App.vue:31", err);
}
});
uni.onPushMessage((res) => {
formatAppLog("log", "at App.vue:35", JSON.stringify(res));
});
@ -580,7 +555,7 @@ if (uni.restoreGlobal) {
function I(e2) {
return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
}
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.49"\n ],\n "debugPort": 9001,\n "initialLaunchType": "local",\n "servePort": 7001,\n "skipFiles": [\n "<node_internals>/**",\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"}]') || [];
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 "<node_internals>/**",\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";

Loading…
Cancel
Save