diff --git a/App.vue b/App.vue
index 110940d..ac32eba 100644
--- a/App.vue
+++ b/App.vue
@@ -103,6 +103,14 @@
if (appid !== 'HBuilder') {
upgrade.checkAndUpdateWgt();
}
+
+ uni.setKeepScreenOn({
+ keepScreenOn:true
+ }).then(res=>{
+ console.log("已设置屏幕常亮");
+ }).catch(ex=>{
+ console.error("设置屏幕常亮失败,ex=",ex)
+ })
// #endif
@@ -110,6 +118,15 @@
onHide: function() {
console.log('App Hide');
// #ifdef APP|APP-PLUS
+
+ uni.setKeepScreenOn({
+ keepScreenOn:false
+ }).then(res=>{
+ console.log("已关闭屏幕常亮");
+ }).catch(ex=>{
+ console.error("设置屏幕常亮失败,ex=",ex)
+ })
+
// 上传中不主动断开:语音上传进行中则不断开蓝牙
let ble = bleTool.getBleTool();
if (ble && ble.isVoiceUploading && ble.isVoiceUploading()) {
diff --git a/components/BottomSlideMenuPlus/BottomSlideMenuPlus.vue b/components/BottomSlideMenuPlus/BottomSlideMenuPlus.vue
index b0f551b..83f020b 100644
--- a/components/BottomSlideMenuPlus/BottomSlideMenuPlus.vue
+++ b/components/BottomSlideMenuPlus/BottomSlideMenuPlus.vue
@@ -33,7 +33,7 @@
- {{ item.text }}
+ {{ item.text }}
@@ -139,8 +139,8 @@
\ No newline at end of file
diff --git a/pages/common/map/index.vue b/pages/common/map/index.vue
index 5a771aa..7d57d3f 100644
--- a/pages/common/map/index.vue
+++ b/pages/common/map/index.vue
@@ -79,16 +79,17 @@ export default {
this.latitude = lat;
this.longitude = lng;
// 创建标记点
+ console.log("devicePic=",marker)
this.covers = [{
id: marker.deviceImei, // 适配deviceId字段
latitude: lat,
longitude: lng,
- iconPath: marker.devicePic || '/static/images/common/mapLocation.png',
- width: 40,
- height: 40,
+ iconPath: '/static/images/common/mapLocation.png',
+ width: 60,
+ height: 60,
anchor: {x: 0.5, y: 0.5}, // 锚点在中心
callout: {
- content: `ID: ${marker.deviceImei}`
+ content: `${marker.deviceName}`
}
}];
@@ -102,17 +103,18 @@ export default {
this.latitude = parseFloat(firstMarker.latitude);
this.longitude = parseFloat(firstMarker.longitude);
+ console.log("devicePic=",marker.devicePic)
// 转换所有有效标记点
this.covers = markers.map((marker, index) => ({
id: marker.deviceId || marker.id || marker.deviceImei || index + 1,
latitude: parseFloat(marker.latitude),
longitude: parseFloat(marker.longitude),
- iconPath: marker.devicePic || '/static/images/common/device.png',
- width: 40,
- height: 40,
+ iconPath: '/static/images/common/mapLocation.png',
+ width: 60,
+ height: 60,
anchor: {x: 0.5, y: 0.5},
callout: {
- content: `ID: ${marker.deviceImei}`,
+ content: `${marker.deviceName}`,
}
}));
diff --git a/pages/common/sosSet/LinkManSetting.vue b/pages/common/sosSet/LinkManSetting.vue
index 565991b..b31c620 100644
--- a/pages/common/sosSet/LinkManSetting.vue
+++ b/pages/common/sosSet/LinkManSetting.vue
@@ -20,7 +20,7 @@
- 修改紧急联系人
+ 编辑紧急联系人
diff --git a/pages/common/user/index.vue b/pages/common/user/index.vue
index fa0e4a7..2161426 100644
--- a/pages/common/user/index.vue
+++ b/pages/common/user/index.vue
@@ -151,7 +151,9 @@
uni.reLaunch({
url: '/pages/common/login/index'
});
- })
+ });
+
+
},
// 退出登录
diff --git a/utils/BleHelper.js b/utils/BleHelper.js
index 3af2e05..ac81cf9 100644
--- a/utils/BleHelper.js
+++ b/utils/BleHelper.js
@@ -768,8 +768,9 @@ class BleHelper {
} catch (convertException) {
if (str && (str.trim().startsWith('{') || str.trim().startsWith('['))) {
console.error("JSON解析失败(可能是格式错误的数据)", convertException);
- console.error("错误的数据", str);
+
}
+ console.error("错误的数据", str);
}
if (isUpdate) {
@@ -790,7 +791,7 @@ class BleHelper {
str: str,
hexs: hexs
};
- // console.log("监听到特征值:", recData);
+ console.log("监听到特征值:", recData);
if (this.cfg.receivDataCallback) {
if (this.cfg.receivDataCallback.length > 0) {
diff --git a/utils/Common.js b/utils/Common.js
index 5cd8c6c..338e6d9 100644
--- a/utils/Common.js
+++ b/utils/Common.js
@@ -491,71 +491,85 @@ export default {
return result;
},
formatTime(value, unit = 'minute') {
- // 边界处理:空值、0或负数
- if (!value || value <= 0) return '0秒';
-
- // 将所有单位统一转换为分钟和总秒数
- let minutes;
- let totalSeconds;
-
- switch (unit) {
- case 'second': // 秒
- minutes = value / 60;
- totalSeconds = value;
- break;
- case 'minute': // 分钟(默认)
- minutes = value;
- totalSeconds = value * 60;
- break;
- case 'hour': // 小时
- minutes = value * 60;
- totalSeconds = value * 3600;
- break;
- case 'day': // 天
- minutes = value * 24 * 60;
- totalSeconds = value * 86400;
- break;
- default:
- minutes = value;
- totalSeconds = value * 60;
- }
-
- // 定义时间单位(分钟)
- const units = [
- { label: '年', minutes: 365 * 24 * 60 },
- { label: '月', minutes: 30 * 24 * 60 }, // 按30天简化计算
- { label: '天', minutes: 24 * 60 },
- { label: '小时', minutes: 60 },
- { label: '分', minutes: 1 }
- ];
-
- let remaining = minutes;
- const parts = [];
-
- for (const unitObj of units) {
- const val = Math.floor(remaining / unitObj.minutes);
- if (val > 0) {
- parts.push(`${val}${unitObj.label}`);
- remaining %= unitObj.minutes;
- }
- }
-
- // 处理剩余的秒数(remaining 现在是小于1分钟的分钟数)
- if (remaining > 0) {
- const seconds = Math.round(remaining * 60);
- if (seconds > 0) {
- parts.push(`${seconds}秒`);
- }
- }
-
- // 如果没有任何部分,返回总秒数
- if (parts.length === 0) {
- return `${Math.floor(totalSeconds)}秒`;
- }
-
- return parts.join('');
+ // 边界处理:空值、0或负数
+ if (!value || value <= 0) return '0秒';
+
+ // 将所有单位统一转换为分钟和总秒数
+ let minutes;
+ let totalSeconds;
+
+ switch (unit) {
+ case 'second': // 秒
+ minutes = value / 60;
+ totalSeconds = value;
+ break;
+ case 'minute': // 分钟(默认)
+ minutes = value;
+ totalSeconds = value * 60;
+ break;
+ case 'hour': // 小时
+ minutes = value * 60;
+ totalSeconds = value * 3600;
+ break;
+ case 'day': // 天
+ minutes = value * 24 * 60;
+ totalSeconds = value * 86400;
+ break;
+ default:
+ minutes = value;
+ totalSeconds = value * 60;
+ }
+
+ // 定义时间单位(分钟)
+ const units = [{
+ label: '年',
+ minutes: 365 * 24 * 60
+ },
+ {
+ label: '月',
+ minutes: 30 * 24 * 60
+ }, // 按30天简化计算
+ {
+ label: '天',
+ minutes: 24 * 60
+ },
+ {
+ label: '小时',
+ minutes: 60
+ },
+ {
+ label: '分',
+ minutes: 1
+ }
+ ];
+
+ let remaining = minutes;
+ const parts = [];
+
+ for (const unitObj of units) {
+ const val = Math.floor(remaining / unitObj.minutes);
+ if (val > 0) {
+ parts.push(`${val}${unitObj.label}`);
+ remaining %= unitObj.minutes;
+ }
+ }
+
+ // 处理剩余的秒数(remaining 现在是小于1分钟的分钟数)
+ if (remaining > 0) {
+ const seconds = Math.round(remaining * 60);
+ if (seconds > 0) {
+ parts.push(`${seconds}秒`);
+ }
+ }
+
+ // 如果没有任何部分,返回总秒数
+ if (parts.length === 0) {
+ return `${Math.floor(totalSeconds)}秒`;
+ }
+
+ return parts.join('');
},
- regeo(lon, lat) {
+ regeo(lon, lat) { //逆地理,将坐标解析出地址
return new Promise((resolve, reject) => {
let url =
'https://restapi.amap.com/v3/geocode/regeo?key=ca3af8a20d628897020893892bda5ae4&location=' +
@@ -579,6 +593,29 @@ export default {
});
});
+ },
+ MapNavi(lon, lat, name, mapType) {//打开地图路线规划页面
+ return new Promise((resolve, reject) => {
+ if (!lon || !lat) {
+ reject("经纬度不能为空");
+ return;
+ }
+
+ let url = "";
+ if (!mapType || mapType == 'amap') {
+ let amapScheme = uni.getSystemInfoSync().platform === 'ios' ? 'iosamap://' : 'androidamap://';
+ url = `${amapScheme}route/plan?sourceApplication=myapp&dlat=${lat}&dlon=${lon}&dname=${name}&dev=0&t=0`;
+ } else {
+ url =`baidumap://map/direction?destination=latlng:${lat},${lon}|name:${name}&coord_type=gcj02&src=myapp`
+ }
+
+ plus.runtime.openURL(url, (ex) => {
+ console.error("ex=",ex);
+ reject("无法打开地图软件"+url);
+ });
+
+
+ });
}
}
\ No newline at end of file
diff --git a/utils/request.js b/utils/request.js
index 9e80407..0ba3db7 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -1,5 +1,5 @@
import config from '../config/index.js';
-export const env = 'development'; //production development //开发of线上 改这里就行
+export const env = 'production'; //production development //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
// console.log("options" + JSON.stringify(options), BASE.BASE_URL)