changemain
This commit is contained in:
parent
446498b893
commit
acace8dc21
@ -2,19 +2,19 @@ const env = 'prod';
|
||||
const configs = {
|
||||
LocalTest: {
|
||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||
h5Url:'http://192.168.88.30:8080/#/'
|
||||
h5Url: 'http://192.168.88.61:2367/#/'
|
||||
},
|
||||
dev: {
|
||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||
h5Url:'http://192.168.88.47:2367/#/'
|
||||
h5Url: 'http://192.168.88.47:2367/#/'
|
||||
},
|
||||
test: {
|
||||
apiBaseUrl: 'https://warehouse.szjixun.cn/oa_backend',
|
||||
h5Url:'http://114.218.158.24:8042/#/'
|
||||
h5Url: 'http://114.218.158.24:8042/#/'
|
||||
},
|
||||
prod: {
|
||||
apiBaseUrl: 'https://oa-a.szjixun.cn/api',
|
||||
h5Url:'https://oa-a.szjixun.cn/#/'
|
||||
h5Url: 'https://oa-a.szjixun.cn/#/'
|
||||
},
|
||||
};
|
||||
const config = configs[env];
|
||||
|
@ -42,52 +42,54 @@ const shareH5 = () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
// import {
|
||||
// registerRequestPermissionTipsListener,
|
||||
// unregisterRequestPermissionTipsListener,
|
||||
// setRequestPermissionTips
|
||||
// } from "@/uni_modules/uni-registerRequestPermissionTips"
|
||||
import {
|
||||
registerRequestPermissionTipsListener,
|
||||
unregisterRequestPermissionTipsListener,
|
||||
setRequestPermissionTips
|
||||
} from "@/uni_modules/uni-registerRequestPermissionTips"
|
||||
|
||||
// const PermissionTips = {
|
||||
// "android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>",
|
||||
// "android.permission.CAMERA": "<h4 style=\"font-size:40px;\">正在访问相机权限</h4><font color=#cccccc>需要扫描二维码或拍照,是否允许打开相机?</font>",
|
||||
// "android.permission.WRITE_EXTERNAL_STORAGE": "<h4 style=\"font-size:40px;\">正在读取相册权限</h4><font color=#cccccc>我们需要获取访问您设备相册的权限,以便您能够选择并上传图片或视频到我们的应用中。</font>"
|
||||
// }
|
||||
// onExit(() => {
|
||||
// unregisterRequestPermissionTipsListener()
|
||||
// })
|
||||
const PermissionTips = {
|
||||
"android.permission.READ_PHONE_STATE": "<h4 style=\"font-size:40px;\">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>",
|
||||
"android.permission.CAMERA": "<h4 style=\"font-size:40px;\">正在访问相机权限</h4><font color=#cccccc>需要扫描二维码或拍照,是否允许打开相机?</font>",
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE": "<h4 style=\"font-size:40px;\">正在读取相册权限</h4><font color=#cccccc>我们需要获取访问您设备相册的权限,以便您能够选择并上传图片或视频到我们的应用中。</font>",
|
||||
"android.permission.ACCESS_FINE_LOCATION": "<h4 style=\"font-size:40px;\">正在访问位置权限</h4><font color=#cccccc>需要获取您的位置信息,以便您能够进行考勤打卡。</font>",
|
||||
"android.permission.ACCESS_COARSE_LOCATION": "<h4 style=\"font-size:40px;\">正在访问位置权限</h4><font color=#cccccc>需要获取您的位置信息,以便您能够进行考勤打卡。</font>"
|
||||
}
|
||||
onExit(() => {
|
||||
unregisterRequestPermissionTipsListener()
|
||||
})
|
||||
|
||||
// const brand = uni.getSystemInfoSync().deviceBrand
|
||||
// setRequestPermissionTips(PermissionTips)
|
||||
// registerRequestPermissionTipsListener({
|
||||
// onRequest: (e) => {
|
||||
// console.log('onRequest', e)
|
||||
// },
|
||||
// onConfirm: (e) => {
|
||||
// commun.sendToH5('permission-application', { action: 'open-permission', data: e });
|
||||
// },
|
||||
// onComplete: (e) => {
|
||||
// commun.sendToH5('permission-application', { action: 'close-permission', data: e });
|
||||
const brand = uni.getSystemInfoSync().deviceBrand
|
||||
setRequestPermissionTips(PermissionTips)
|
||||
registerRequestPermissionTipsListener({
|
||||
onRequest: (e) => {
|
||||
console.log('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: "权限已经被拒绝,请前往设置中开启"
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// 华为手机在权限禁止之后,再次申请权限不会出现权限申请框。此时应该引导用户去系统设置开启此权限,不应该频繁申请。
|
||||
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: "权限已经被拒绝,请前往设置中开启"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
const webLoad = (e) => {
|
||||
const message = e.detail.data?.[0] || '';
|
||||
commun.handleMessage(message);
|
||||
|
Loading…
Reference in New Issue
Block a user