This commit is contained in:
xingyy 2024-08-28 14:07:51 +08:00
parent 98745b859b
commit 89a7960fd3
13 changed files with 68 additions and 57 deletions

View File

@ -1,4 +1,4 @@
const env = 'dev'; const env = 'test';
const configs = { const configs = {
LocalTest: { LocalTest: {
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend', apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
@ -17,7 +17,6 @@ const configs = {
h5Url:'https://oa-a.szjixun.cn/#/' h5Url:'https://oa-a.szjixun.cn/#/'
}, },
}; };
const config = configs[env]; const config = configs[env];
export default config; export default config;

View File

@ -10,7 +10,6 @@ const app = new Vue({
}) })
app.$mount() app.$mount()
// #endif // #endif
// #ifdef VUE3 // #ifdef VUE3
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
export function createApp() { export function createApp() {

View File

@ -2,8 +2,8 @@
"name" : "oa考勤系统", "name" : "oa考勤系统",
"appid" : "__UNI__4796942", "appid" : "__UNI__4796942",
"description" : "", "description" : "",
"versionName" : "2.0.4", "versionName" : "2.1.0",
"versionCode" : 204, "versionCode" : 210,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -6,15 +6,57 @@
import config from "../../config"; import config from "../../config";
import {onExit } from "@dcloudio/uni-app"; import {onExit } from "@dcloudio/uni-app";
import { Communication } from '../../utils/communication.js'; import { Communication } from '../../utils/communication.js';
const commun=new Communication() const commun=new Communication()
const permissionListener = uni.createRequestPermissionListener();
/* import {
registerRequestPermissionTipsListener,
unregisterRequestPermissionTipsListener,
setRequestPermissionTips
} from "@/uni_modules/uni-registerRequestPermissionTips"
const PermissionTips = {
"android.permission.CAMERA": "<h4 style=\"font-size:40px;\">正在读取通讯录权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意</font>",
"android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>"
}
onExit(()=>{ onExit(()=>{
permissionListener.stop() unregisterRequestPermissionTipsListener()
}) })
const brand = uni.getSystemInfoSync().deviceBrand
setRequestPermissionTips(PermissionTips)
registerRequestPermissionTipsListener({
onRequest: (e) => {
},
onConfirm: (e) => {
commun.sendToH5('permission-application',{action:'open-permission',data:e});
},
onComplete: (e) => {
commun.sendToH5('permission-application',{action:'close-permission',data:e});
//
if (brand.toLowerCase() === "huawei") {
const tips = {}
let hasDeniedPermission = false
for (let k in PermissionTips) {
if (e[k] !== "denied") {
tips[k] = PermissionTips[k]
} else {
hasDeniedPermission = true
}
}
setRequestPermissionTips(tips) //
if (hasDeniedPermission)
uni.showModal({
content: "权限已经被拒绝,请前往设置中开启"
})
}
}
}) */
function initializeWebView() { function initializeWebView() {
const currentWebview = getCurrentPages().pop().$getAppWebview() const currentWebview = getCurrentPages().pop().$getAppWebview()
commun.setWebView(currentWebview.children()[0]) commun.setWebView(currentWebview.children()[0])
} }
//load-complete
commun.registerHandler('load-complete',()=>{ commun.registerHandler('load-complete',()=>{
initializeWebView() initializeWebView()
const {statusBarHeight} = uni.getSystemInfoSync() const {statusBarHeight} = uni.getSystemInfoSync()
@ -22,16 +64,7 @@ onExit(()=>{
top: statusBarHeight, top: statusBarHeight,
bottom: 0, bottom: 0,
}) })
permissionListener.onRequest((e)=>{
commun.sendToH5('permission-application',e);
})
permissionListener.onConfirm((e) => {
});
permissionListener.onComplete((e) => {
console.log('APP执行onComplete',e)
const arr=['android.permission.ACCESS_COARSE_LOCATION','android.permission.ACCESS_FINE_LOCATION','android.permission.ACCESS_LOCATION_EXTRA_COMMANDS','android.permission.ACCESS_MOCK_LOCATION']
commun.sendToH5('permission-complete',e);
})
}) })
const webLoad = (e) => { const webLoad = (e) => {
const message = e.detail.data?.[0] || ''; const message = e.detail.data?.[0] || '';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -7,8 +7,8 @@
"id": "__UNI__4796942", "id": "__UNI__4796942",
"name": "oa考勤系统", "name": "oa考勤系统",
"version": { "version": {
"name": "2.0.4", "name": "2.1.0",
"code": 204 "code": 210
}, },
"description": "", "description": "",
"developer": { "developer": {

File diff suppressed because one or more lines are too long

View File

@ -32,22 +32,7 @@ if (uni.restoreGlobal) {
(function(vue) { (function(vue) {
"use strict"; "use strict";
var _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n; var _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n;
const ON_EXIT = "onExit"; const env = "test";
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
console[type].apply(console, [...args, filename]);
}
}
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
}
const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
!vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
};
const onExit = /* @__PURE__ */ createHook(ON_EXIT);
const env = "dev";
const configs = { const configs = {
LocalTest: { LocalTest: {
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend", apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
@ -67,6 +52,16 @@ if (uni.restoreGlobal) {
} }
}; };
const config = configs[env]; const config = configs[env];
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
console[type].apply(console, [...args, filename]);
}
}
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
}
class Communication { class Communication {
constructor() { constructor() {
this.webViewObj = null; this.webViewObj = null;
@ -106,10 +101,6 @@ if (uni.restoreGlobal) {
__name: "index", __name: "index",
setup(__props) { setup(__props) {
const commun = new Communication(); const commun = new Communication();
const permissionListener = uni.createRequestPermissionListener();
onExit(() => {
permissionListener.stop();
});
function initializeWebView() { function initializeWebView() {
const currentWebview = getCurrentPages().pop().$getAppWebview(); const currentWebview = getCurrentPages().pop().$getAppWebview();
commun.setWebView(currentWebview.children()[0]); commun.setWebView(currentWebview.children()[0]);
@ -121,15 +112,6 @@ if (uni.restoreGlobal) {
top: statusBarHeight, top: statusBarHeight,
bottom: 0 bottom: 0
}); });
permissionListener.onRequest((e2) => {
commun.sendToH5("permission-application", e2);
});
permissionListener.onConfirm((e2) => {
});
permissionListener.onComplete((e2) => {
formatAppLog("log", "at pages/index/index.vue:31", "APP执行onComplete", e2);
commun.sendToH5("permission-complete", e2);
});
}); });
const webLoad = (e2) => { const webLoad = (e2) => {
var _a; var _a;
@ -3194,7 +3176,7 @@ if (uni.restoreGlobal) {
function I(e2) { function I(e2) {
return e2 && "string" == typeof e2 ? JSON.parse(e2) : 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), C = b, P = I('{\n "address": [\n "127.0.0.1",\n "192.168.56.1",\n "192.168.88.56"\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'), T = I('[{"provider":"alipay","spaceName":"oaapp","spaceId":"env-00jxgxphla18","spaceAppId":"2021004145628977","accessKey":"ZALus7EgJXdovISb","secretKey":"7qzvVrPN0mAxfcLr"}]') || []; const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), C = b, P = I('{\n "address": [\n "127.0.0.1",\n "192.168.56.1",\n "192.168.88.53"\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'), T = I('[{"provider":"alipay","spaceName":"oaapp","spaceId":"env-00jxgxphla18","spaceAppId":"2021004145628977","accessKey":"ZALus7EgJXdovISb","secretKey":"7qzvVrPN0mAxfcLr"}]') || [];
let O = ""; let O = "";
try { try {
O = "__UNI__4796942"; O = "__UNI__4796942";

View File

@ -7,8 +7,8 @@
"id": "__UNI__4796942", "id": "__UNI__4796942",
"name": "oa考勤系统", "name": "oa考勤系统",
"version": { "version": {
"name": "2.0.4", "name": "2.1.0",
"code": 204 "code": 210
}, },
"description": "", "description": "",
"developer": { "developer": {