This commit is contained in:
weipengfei 2024-01-12 15:13:29 +08:00
parent 9f9a8ec903
commit 81ecc62dfd
37 changed files with 481 additions and 219 deletions

View File

@ -15,6 +15,10 @@
{
"playground" : "custom",
"type" : "uni-app:app-android"
},
{
"playground" : "custom",
"type" : "uni-app:app-ios"
}
]
}

19
App.vue
View File

@ -1,6 +1,25 @@
<script>
import {login} from '@/api/api.js'
export default {
onLaunch: function() {
let query = uni.getStorageSync('query');
if(query){
login(JSON.parse(query)).then(res=>{
console.log('登录成功');
this.$store.commit('SET_USERINFO', res.member);
this.$store.commit('SET_TOKEN', {
token: res.tokenList.tokenType ? res.tokenList.tokenType + ' ' + res.tokenList.accessToken : res.tokenList.accessToken,
token_time: res.tokenList.accessTokenExp
});
}).catch(err=>{
console.log('登录失败');
uni.redirectTo({
url: '/pages/login/login'
})
})
}else uni.redirectTo({
url: '/pages/login/login'
})
console.log('App Launch')
},
onShow: function() {

View File

@ -11,8 +11,8 @@
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"alwaysShowBeforeRender" : false,
"waiting" : false,
"autoclose" : true,
"delay" : 0
},
@ -46,7 +46,8 @@
},
/* ios */
"ios" : {
"dSYMs" : false
"dSYMs" : false,
"UIBackgroundModes" : "location"
},
/* SDK */
"sdkConfigs" : {
@ -58,7 +59,7 @@
"name" : "amaptOT5SLwK",
"__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "2ad33d95be57c3169cb881a7d2b1712f"
"appkey_android" : "2ad33d95be57c3169cb881a7d2b17133"
}
},
"ad" : {}

View File

@ -1,16 +1,33 @@
<template>
<div>
<view>
<!-- <button type="primary" @click="trackLocation" v-if="!isGetLocation">持续定位</button>
<button type="primary" @click="stopLocation" v-else>停止持续定位</button> -->
<!-- <button type="primary" @click="onceLocation">单次定位</button> -->
<button type="primary" @click="trackLocation" v-if="!isGetLocation">持续定位</button>
<button type="primary" @click="stopLocation" v-else>停止持续定位</button>
<!-- <button type="primary" @click="calcDistance">坐标距离计算</button> -->
<!-- <button type="primary" @click="onGeoQuery">坐标反查</button> -->
<!-- <button type="primary" @click="onRoutePlan">路径规划(唤起外部地图导航)</button> -->
<!-- <button type="primary" @click="switchCoordType">切换坐标系,当前:{{coordType}}</button> -->
<view class="">
<text :selectable="true">{{result}}</text>
<view class="c-btn">
<view class="cc" @click="trackLocation" v-if="!isGetLocation">
<text class="title">开始定位</text>
<text class="text" v-if="count">定位成功次数:{{count}}次</text>
<text class="text" v-if="time">{{time}}</text>
<text class="text log" v-if="log">{{log}}</text>
</view>
<view class="cc rr" @click="stopLocation" v-else>
<text class="title">结束定位</text>
<text class="text">定位成功次数:{{count}}次</text>
<text class="text" v-if="time">{{time}}</text>
<text class="text log" v-if="log">{{log}}</text>
</view>
<text class="tips" @click="restart">遇到问题了? 点击重启</text>
</view>
</div>
<!-- <view class="">
<text :selectable="true">{{result}}</text>
</view> -->
</view>
</template>
<script>
@ -33,7 +50,8 @@
isGetLocation: false,
errCount: 0, //定位失败次数
timer: null,
count: 0
count: 0,
time: '',
}
},
//退出页面后停止定位
@ -92,6 +110,7 @@
},
//连续定位
trackLocation() {
if(this.errCount==-1) this.restart(); // 如果出现问题, 直接重启app
try{
// #ifdef APP-PLUS
addKeepalive();
@ -99,7 +118,7 @@
this.result = '';
let count = 0;
this.isGetLocation = true;
this.phoneLocation();
this.phoneLocation();
aMapHelper.trackLocation({
intervalTime: 6*1000,
notificationTitle: '工单系统',
@ -167,21 +186,25 @@
success: (res) => {
console.log('本机获取定位成功', res);
res = wgsToGcj(res);
this.result = `
定位次数:${this.count}
定位时间:${this.formatDate(new Date())}
坐标:${res.longitude},${res.latitude}`
// this.result = `
// 定位次数:${this.count}
// 定位时间:${this.formatDate(new Date())}
// 坐标:${res.longitude},${res.latitude}`
this.time = this.formatDate(new Date());
positioning({
member_code: this.userInfo.code,
positioning: `${res.longitude},${res.latitude}`
}).then(ok=>{
console.log('上传成功', ok);
this.log = '';
}).catch(err=>{
console.log('上传失败', err);
this.log = '错误!网络状态不佳';
})
},
fail: (err) => {
console.log('本机获取定位失败', err);
this.log = '错误!定位失败,请重启应用重试!';
}
})
},
@ -200,6 +223,7 @@
aMapHelper.stopLocation();
clearInterval(this.timer);
this.isGetLocation = false;
this.errCount = -1;
},
//计算坐标距离
calcDistance() {
@ -247,7 +271,52 @@
switchCoordType() {
this.coordIndex = (this.coordIndex + 1) % 3;
aMapHelper.stopLocation();
}
},
restart() {
if (typeof plus !== 'undefined') { // 检查是否在 App 中运行
plus.runtime.restart()
}
},
}
}
</script>
</script>
<style lang="scss">
.c-btn{
// background-color: #33ff33;
width: 750rpx;
height: 750rpx;
margin-top: 100rpx;
justify-content: center;
align-items: center;
.cc{
height: 500rpx;
width: 500rpx;
background-color: #42b983;
justify-content: center;
align-items: center;
// background-color: rgba(#42b983, 0.5);
// border: 5rpx solid #42b983;
border-radius: 400rpx;
.title{
color: #fff;
font-size: 44rpx;
}
.text{
color: #fff;
font-size: 28rpx;
}
.log{
color: red;
font-size: 34rpx;
}
}
.rr{
background-color: #e6852c;
}
.tips{
color: #999;
padding-top: 30rpx;
}
}
</style>

View File

@ -31,8 +31,8 @@ import {login} from '@/api/api.js'
export default {
data() {
return {
account: '123456', //
password: '123456' //
account: '', //
password: '' //
};
},
onLoad() {

View File

@ -13,6 +13,7 @@ const mutations = {
state.token = '';
uni.removeStorageSync('user_info');
uni.removeStorageSync('token');
uni.removeStorageSync('query');
},
SET_TOKEN(state, data) {
state.token = data.token;

17
unpackage/cache/appleConfig.ini vendored Normal file
View File

@ -0,0 +1,17 @@
[appleAppid]
appleAppid=uni.UNIBAAC5A9
[iosStyle]
iosStyle=
[universalLinks]
universalLinks=
spaceid=
[universalLinks_qq]
universalLinks_qq=
spaceid_qq=
[universalLinks_weibo]
universalLinks_weibo=
spaceid_weibo=

3
unpackage/cache/certdataios vendored Normal file
View File

@ -0,0 +1,3 @@
iosProfile=D:/里海项目/IOS证书/工单/ceshi_gongdan(1).mobileprovision
ioscertFile=D:/里海项目/IOS证书/商城/商城/打包/测试证书.p12
ioscertPassword=XEPAuombvl46UIdlbTyQ/w==

View File

@ -0,0 +1 @@
{"dir":"/Users/seaman/srv/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/2f890390-b0f5-11ee-a79b-771a18584267/wgtRoot/__UNI__BAAC5A9/"}

View File

@ -0,0 +1,14 @@
{
"version": "1",
"env": {
"compilerVersion": "3.98.2023112510"
},
"files": {
"utssdk/app-ios/index.uts": {
"md5": "d41d8cd98f00b204e9800998ecf8427e"
},
"package.json": {
"md5": "4943bc10768f31cb2bf250ec24cf4165"
}
}
}

View File

@ -1 +0,0 @@
{"version":3,"sources":["uni_modules/fdm-keepalive/utssdk/app-android/index.uts"],"sourcesContent":["import Context from \"android.content.Context\";\nimport { UTSAndroid } from \"io.dcloud.uts\";\nimport PowerManager from 'android.os.PowerManager';\nimport Intent from 'android.content.Intent';\nimport Settings from 'android.provider.Settings';\nimport Uri from 'android.net.Uri';\n\nclass WakeLockHelper{\n\tcontext: Context\n\tprivate wakeLock: PowerManager.WakeLock | null = null;\n\tconstructor(context: Context){\n\t\tthis.context = context\n\t}\n\tacquireWakeLock(){\n\t\tlet powerManager = this.context.getSystemService(Context.POWER_SERVICE) as PowerManager;\n\t\tthis.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,\"MyApp::TestWakeLock\");\n\t\tthis.wakeLock?.acquire();\n\t}\n\treleaseWakeLock() {\n\t\tthis.wakeLock?.release();\n\t\tthis.wakeLock = null\n\t}\n}\n\nexport default function addKeepalive(){\n\tconst context = UTSAndroid.getAppContext();\n\tconst pageName = context!.getPackageName();\n\tconst manager = context!.getSystemService(\n\t\tContext.POWER_SERVICE\n\t) as PowerManager;\n\tif(!manager.isIgnoringBatteryOptimizations(pageName)){\n\t\tlet jumpUrl: Uri = Uri.parse(\"package:\" + pageName);\n\t\tlet intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, jumpUrl);\n\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\tUTSAndroid.getAppContext()!.startActivity(intent);\n\t}\n\tlet wakeCtrl = new WakeLockHelper(context);\n\twakeCtrl.acquireWakeLock();\n\tconsole.log(manager.isInteractive());\n}\n"],"names":[],"mappings":";;;;;;;AAAA,OAAoB,uBAAyB,CAAC;AAC9C;AACA,OAAyB,uBAAyB,CAAC;AACnD,OAAmB,sBAAwB,CAAC;AAC5C,OAAqB,yBAA2B,CAAC;AACjD,OAAgB,eAAiB,CAAC;AAElC,WAAM;IACL,SAAA,SAAS,QAAO;IAChB,YAAQ,UAAU,aAAa,YAAkB,IAAI,CAAC;IACtD,YAAY,SAAS,OAAO,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG;IAChB;IACA,SAAA,kBAAiB;QAChB,IAAI,eAAe,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,aAAa,KAAK;QAC3E,IAAI,CAAC,QAAQ,GAAG,aAAa,WAAW,CAAC,aAAa,iBAAiB,EAAC;QACxE,IAAI,CAAC,QAAQ,EAAE;IAChB;IACA,SAAA,kBAAkB;QACjB,IAAI,CAAC,QAAQ,EAAE;QACf,IAAI,CAAC,QAAQ,GAAG,IAAI;IACrB;AACD;AAEe,IAAS,eAAc;IACrC,IAAM,UAAU,WAAW,aAAa;IACxC,IAAM,WAAW,UAAS,cAAc;IACxC,IAAM,UAAU,UAAS,gBAAgB,CACxC,QAAQ,aAAa,KACjB;IACL,IAAG,CAAC,QAAQ,8BAA8B,CAAC,WAAU;QACpD,IAAI,SAAS,MAAM,IAAI,KAAK,CAAC,aAAa;QAC1C,IAAI,SAAS,AAAI,OAAO,SAAS,2CAA2C,EAAE;QAC9E,OAAO,QAAQ,CAAC,OAAO,sBAAsB;QAC7C,WAAW,aAAa,KAAI,aAAa,CAAC;IAC3C;IACA,IAAI,WAAW,AAAI,eAAe;IAClC,SAAS,eAAe;IACxB,QAAQ,GAAG,CAAC,QAAQ,aAAa;AAClC"}

View File

@ -1,20 +0,0 @@
{
"version": "1",
"env": {
"compilerVersion": "3.98.2023112510"
},
"files": {
"utssdk/app-android/index.uts": {
"md5": "3822af6e984763925bc53876356f8e90"
},
"package.json": {
"md5": "4943bc10768f31cb2bf250ec24cf4165"
},
"utssdk/app-android/AndroidManifest.xml": {
"md5": "aea615f4a37cf0a7e572502bd9fd46c3"
},
"utssdk/app-android/config.json": {
"md5": "ac167de9e1ad3b88ae7a845b39dff0e9"
}
}
}

View File

@ -0,0 +1,14 @@
{
"version": "1",
"env": {
"compilerVersion": "3.98.2023112510"
},
"files": {
"utssdk/app-ios/index.uts": {
"md5": "d41d8cd98f00b204e9800998ecf8427e"
},
"package.json": {
"md5": "4943bc10768f31cb2bf250ec24cf4165"
}
}
}

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"],"packagename":"uni.UNIBAAC5A9","custompermissions":true},"apple":{"dSYMs":false,"plistcmds":["Add :UIFileSharingEnabled bool true"],"devices":"universal"},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"geolocation":{"amap":{"__platform__":["android"],"appkey_android":"2ad33d95be57c3169cb881a7d2b1712f","appkey_ios":"","name":"amaptOT5SLwK"},"system":{"__platform__":["ios","android"]}}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"nativePlugins":{"SLY-AMapHelper":{},"Sj-Keep":{}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]},"adid":"120478170009"}}
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"minSdkVersion":23,"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"],"custompermissions":true},"apple":{"UIBackgroundModes":"location","dSYMs":false,"appid":"uni.UNIBAAC5A9","password":"XEPAuombvl46UIdlbTyQ/w==","mobileprovision":"apple-mobileprovision.mobileprovision","p12":"apple-private.p12","devices":"iphone","plistcmds":["Add :UIFileSharingEnabled bool true"]},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"geolocation":{"amap":{"__platform__":["android"],"appkey_android":"2ad33d95be57c3169cb881a7d2b1712f","appkey_ios":"","name":"amaptOT5SLwK"},"system":{"__platform__":["ios","android"]}}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"nativePlugins":{"SLY-AMapHelper":{}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]},"adid":"120478170009"}}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="io.dcloud.uni_modules.fdm_keepalive">
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>

View File

@ -1,3 +0,0 @@
{
"minSdkVersion": "23"
}

View File

@ -1,49 +0,0 @@
package uts.sdk.modules.fdmKeepalive;
import io.dcloud.uniapp.*;
import io.dcloud.uniapp.extapi.*;
import io.dcloud.uts.*;
import io.dcloud.uts.Map;
import io.dcloud.uts.Set;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.async;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.provider.Settings;
import io.dcloud.uts.UTSAndroid;
import android.net.Uri;
open class WakeLockHelper {
open var context: Context;
private var wakeLock: PowerManager.WakeLock? = null;
constructor(context: Context){
this.context = context;
}
open fun acquireWakeLock() {
var powerManager = this.context.getSystemService(Context.POWER_SERVICE) as PowerManager;
this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyApp::TestWakeLock");
this.wakeLock?.acquire();
}
open fun releaseWakeLock() {
this.wakeLock?.release();
this.wakeLock = null;
}
}
fun addKeepalive() {
val context = UTSAndroid.getAppContext();
val pageName = context!!.getPackageName();
val manager = context!!.getSystemService(Context.POWER_SERVICE) as PowerManager;
if (!manager.isIgnoringBatteryOptimizations(pageName)) {
var jumpUrl: Uri = Uri.parse("package:" + pageName);
var intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, jumpUrl);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
UTSAndroid.getAppContext()!!.startActivity(intent);
}
var wakeCtrl = WakeLockHelper(context);
wakeCtrl.acquireWakeLock();
console.log(manager.isInteractive(), " at uni_modules/fdm-keepalive/utssdk/app-android/index.uts:39");
}
fun addKeepaliveByJs() {
return addKeepalive();
}

View File

@ -0,0 +1 @@
import DCloudUTSFoundation;

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"]},"apple":{"dSYMs":false},"plugins":{"geolocation":{"system":{"__platform__":["ios","android"]},"amap":{"name":"amaptOT5SLwK","__platform__":["android"],"appkey_ios":"","appkey_android":"2ad33d95be57c3169cb881a7d2b1712f"}},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"nativePlugins":{"SLY-AMapHelper":{"__plugin_info__":{"name":"后台持续定位、轨迹追踪、可锁屏","description":"基于高德地图的后台持续定位、轨迹追踪、后台保活、锁屏定位。已处理主流系统权限申请流程,省心快速接入,提供演示程序下载[问题反馈404342398@qq.com]","platforms":"Android","url":"https://ext.dcloud.net.cn/plugin?id=6267","android_package_name":"uni.UNIBAAC5A9","ios_bundle_id":"","isCloud":true,"bought":1,"pid":"6267","parameters":{}}},"Sj-Keep":{"__plugin_info__":{"name":"安卓保活插件,后台持续运行,灵活控制。 - [试用版,仅用于自定义调试基座]","description":"安卓保活插件,后台持续运行,灵活控制。","platforms":"Android","url":"https://ext.dcloud.net.cn/plugin?id=16143","android_package_name":"","ios_bundle_id":"","isCloud":true,"bought":0,"pid":"16143","parameters":{}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]}}}
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"],"minSdkVersion":23},"apple":{"dSYMs":false,"UIBackgroundModes":"location"},"plugins":{"geolocation":{"system":{"__platform__":["ios","android"]},"amap":{"name":"amaptOT5SLwK","__platform__":["android"],"appkey_ios":"","appkey_android":"2ad33d95be57c3169cb881a7d2b1712f"}},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"nativePlugins":{"SLY-AMapHelper":{"__plugin_info__":{"name":"后台持续定位、轨迹追踪、可锁屏","description":"基于高德地图的后台持续定位、轨迹追踪、后台保活、锁屏定位。已处理主流系统权限申请流程,省心快速接入,提供演示程序下载[问题反馈404342398@qq.com]","platforms":"Android","url":"https://ext.dcloud.net.cn/plugin?id=6267","android_package_name":"uni.UNIBAAC5A9","ios_bundle_id":"","isCloud":true,"bought":1,"pid":"6267","parameters":{}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]}}}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="io.dcloud.uni_modules.fdm_keepalive">
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>

View File

@ -1,3 +0,0 @@
{
"minSdkVersion": "23"
}

View File

@ -1,49 +0,0 @@
package uts.sdk.modules.fdmKeepalive;
import io.dcloud.uniapp.*;
import io.dcloud.uniapp.extapi.*;
import io.dcloud.uts.*;
import io.dcloud.uts.Map;
import io.dcloud.uts.Set;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.async;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.provider.Settings;
import io.dcloud.uts.UTSAndroid;
import android.net.Uri;
open class WakeLockHelper {
open var context: Context;
private var wakeLock: PowerManager.WakeLock? = null;
constructor(context: Context){
this.context = context;
}
open fun acquireWakeLock() {
var powerManager = this.context.getSystemService(Context.POWER_SERVICE) as PowerManager;
this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyApp::TestWakeLock");
this.wakeLock?.acquire();
}
open fun releaseWakeLock() {
this.wakeLock?.release();
this.wakeLock = null;
}
}
fun addKeepalive() {
val context = UTSAndroid.getAppContext();
val pageName = context!!.getPackageName();
val manager = context!!.getSystemService(Context.POWER_SERVICE) as PowerManager;
if (!manager.isIgnoringBatteryOptimizations(pageName)) {
var jumpUrl: Uri = Uri.parse("package:" + pageName);
var intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, jumpUrl);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
UTSAndroid.getAppContext()!!.startActivity(intent);
}
var wakeCtrl = WakeLockHelper(context);
wakeCtrl.acquireWakeLock();
console.log(manager.isInteractive(), " at uni_modules/fdm-keepalive/utssdk/app-android/index.uts:39");
}
fun addKeepaliveByJs() {
return addKeepalive();
}

View File

@ -0,0 +1 @@
import DCloudUTSFoundation;

View File

@ -1,7 +1,7 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/index/index","pages/test/test","pages/login/login"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"工单系统","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"white","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"work_order","compilerVersion":"3.98","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniConfig = {"pages":["pages/index/index","pages/test/test","pages/login/login"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"工单系统","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"white","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":false,"autoclose":true},"appname":"work_order","compilerVersion":"3.98","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isNVue":true,"isTabBar":true},"window":{"navigationBarTitleText":"定位"}},{"path":"/pages/test/test","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","enablePullDownRefresh":false}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"transparentTitle":"always"}}];
__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()})}});

File diff suppressed because one or more lines are too long

View File

@ -1310,7 +1310,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../HBuilderX.3.96.2023110403/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/*每个页面公共css */\n", ""]);
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/*每个页面公共css */\n", ""]);
// Exports
module.exports = exports;

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"],"minSdkVersion":23},"apple":{"dSYMs":false},"plugins":{"geolocation":{"system":{"__platform__":["ios","android"]},"amap":{"name":"amaptOT5SLwK","__platform__":["android"],"appkey_ios":"","appkey_android":"2ad33d95be57c3169cb881a7d2b1712f"}},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"nativePlugins":{"SLY-AMapHelper":{"__plugin_info__":{"name":"后台持续定位、轨迹追踪、可锁屏","description":"基于高德地图的后台持续定位、轨迹追踪、后台保活、锁屏定位。已处理主流系统权限申请流程,省心快速接入,提供演示程序下载[问题反馈404342398@qq.com]","platforms":"Android","url":"https://ext.dcloud.net.cn/plugin?id=6267","android_package_name":"uni.UNIBAAC5A9","ios_bundle_id":"","isCloud":true,"bought":1,"pid":"6267","parameters":{}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]}}}
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__BAAC5A9","name":"work_order","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":false,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview","render":"always","uniNView":{"path":"pages/index/index.js"}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"],"minSdkVersion":23},"apple":{"dSYMs":false,"UIBackgroundModes":"location"},"plugins":{"geolocation":{"system":{"__platform__":["ios","android"]},"amap":{"name":"amaptOT5SLwK","__platform__":["android"],"appkey_ios":"","appkey_android":"2ad33d95be57c3169cb881a7d2b17133"}},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"nativePlugins":{"SLY-AMapHelper":{"__plugin_info__":{"name":"后台持续定位、轨迹追踪、可锁屏","description":"基于高德地图的后台持续定位、轨迹追踪、后台保活、锁屏定位。已处理主流系统权限申请流程,省心快速接入,提供演示程序下载[问题反馈404342398@qq.com]","platforms":"Android","url":"https://ext.dcloud.net.cn/plugin?id=6267","android_package_name":"uni.UNIBAAC5A9","ios_bundle_id":"","isCloud":true,"bought":1,"pid":"6267","parameters":{}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#eee","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.98","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#0074e8","borderStyle":"rgba(255,255,255,0.4)","backgroundColor":"#eee","list":[{"pagePath":"pages/index/index","text":"首页"},{"pagePath":"pages/test/test","text":"我的"}],"height":"50px","child":["lauchwebview"]}}}

File diff suppressed because one or more lines are too long