diff --git a/App.vue b/App.vue
index faaf989..a21853c 100644
--- a/App.vue
+++ b/App.vue
@@ -30,43 +30,41 @@
//以上代码仅在开发时使用,否则会出现不可预知的问题。
// #ifdef APP|APP-PLUS
-
- bleTool.getBleTool();
-
- var appid = plus.runtime.appid;
- console.log('应用的 appid 为:' + appid);
-
+ if (plus.runtime.isAgreePrivacy()) {
+
+
+ bleTool.getBleTool();
- uni.getPushClientId({
- success(res) {
- console.log("推送信息:", res);
- uni.setStorageSync('push_cid', res.cid);
- },
- fail(err) {
- console.error(err)
+ uni.getPushClientId({
+ success(res) {
+ console.log("推送信息:", res);
+ uni.setStorageSync('push_cid', res.cid);
+ },
+ fail(err) {
+ console.error(err)
+ }
+ });
+ if (!uni.setAppBadgeNumber) { //兼容鸿蒙的写法
+ uni.setAppBadgeNumber = plus.runtime.setBadgeNumber;
}
- });
- if(!uni.setAppBadgeNumber){//兼容鸿蒙的写法
- uni.setAppBadgeNumber=plus.runtime.setBadgeNumber;
- }
- uni.onPushMessage((res) => {
- console.log("收到推送消息:", res); //监听推送消息
- if(res.type=='click'){
- //将App角标设置为0,清空app在消息中心的所有消息
- uni.setAppBadgeNumber(0);
- plus.push.clear();
- return;
- }
- uni.createPushMessage({
- title: res.data.title,
- content: res.data.content,
- payload:res.data.payload
+ uni.onPushMessage((res) => {
+ console.log("收到推送消息:", res); //监听推送消息
+ if (res.type == 'click') {
+ //将App角标设置为0,清空app在消息中心的所有消息
+ uni.setAppBadgeNumber(0);
+ plus.push.clear();
+ return;
+ }
+ uni.createPushMessage({
+ title: res.data.title,
+ content: res.data.content,
+ payload: res.data.payload
+ });
+
});
- });
-
-
+ }
// #endif
},
@@ -74,18 +72,15 @@
console.log('App Show');
//将检查更新换到onshow,因为苹果用户喜欢一直挂着
- uni.getSystemInfo({
- success: function(res) {
- if (res.uniPlatform == 'app') {
-
- let appid = plus.runtime.appid;
- if (appid !== 'HBuilder') {
- console.log("appid=", appid);
- upgrade.checkAndUpdateWgt();
- }
- }
- }
- });
+ // #ifdef APP|APP-PLUS
+
+ let appid = plus.runtime.appid;
+ console.log("appid=", appid);
+
+ if (appid !== 'HBuilder') {
+ upgrade.checkAndUpdateWgt();
+ }
+ // #endif
},
onHide: function() {
console.log('App Hide');
@@ -212,5 +207,4 @@
font-family: "PingFangBold";
src: url("~@/static/fonts/PingFangBold.ttf") format("opentype");
}
-
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 8bc5df7..64d3058 100644
--- a/pages.json
+++ b/pages.json
@@ -52,8 +52,7 @@
{
"path": "pages/common/send/index",
"style": {
- "navigationBarTitleText": "发送信息",
- "enablePullDownRefresh": true
+ "navigationBarTitleText": "发送信息"
}
},
{
@@ -102,10 +101,9 @@
}
},
{
- "path": "pages/6170/callPolice/index",
+ "path": "pages/common/callPolice/index",
"style": {
- "navigationBarTitleText": "报警",
- "enablePullDownRefresh": true
+ "navigationBarTitleText": "报警"
}
},
@@ -160,14 +158,7 @@
"navigationStyle": "custom"
}
},
- {
- "path": "pages/6155/ImgCrop",
- "style": {
- "navigationBarTitleText": "图像裁剪",
- "navigationStyle": "custom",
- "fullscreen": true
- }
- },
+
{
"path": "pages/6075/BJQ6075",
"style": {
@@ -447,6 +438,14 @@
{
"navigationStyle": "custom"
}
+ },
+ {
+ "path": "pages/common/ImgCrop/ImgCrop",
+ "style": {
+ "navigationBarTitleText": "图像裁剪",
+ "navigationStyle": "custom",
+ "fullscreen": true
+ }
}
],
diff --git a/pages/6075/BJQ6075.vue b/pages/6075/BJQ6075.vue
index a61429b..3e4d8dc 100644
--- a/pages/6075/BJQ6075.vue
+++ b/pages/6075/BJQ6075.vue
@@ -679,7 +679,7 @@
}
let that = this;
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOverPath: function(data) {
that.selectedImage = data.picPath;
diff --git a/pages/6075J/BJQ6075J.vue b/pages/6075J/BJQ6075J.vue
index 20b4efa..8115957 100644
--- a/pages/6075J/BJQ6075J.vue
+++ b/pages/6075J/BJQ6075J.vue
@@ -1145,7 +1145,7 @@
sourceType: ['album'],
success: function(res) {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
diff --git a/pages/6155/BJQ6155.vue b/pages/6155/BJQ6155.vue
index 8cc8ad8..72f80b0 100644
--- a/pages/6155/BJQ6155.vue
+++ b/pages/6155/BJQ6155.vue
@@ -909,7 +909,7 @@
sourceType: ['album'],
success: function(res) {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
diff --git a/pages/6155/ImgCrop.vue b/pages/6155/ImgCrop.vue
index c6209ea..e69de29 100644
--- a/pages/6155/ImgCrop.vue
+++ b/pages/6155/ImgCrop.vue
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue
index 714ed14..1170edb 100644
--- a/pages/6155/deviceDetail.vue
+++ b/pages/6155/deviceDetail.vue
@@ -926,7 +926,7 @@
sourceType: ['album'],
success: function(res) {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue
index 903511c..c18438c 100644
--- a/pages/6170/deviceControl/index.vue
+++ b/pages/6170/deviceControl/index.vue
@@ -979,7 +979,7 @@
}
let that = this;
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
that.selectedImage = data.picPath;
diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue
index eadbee2..6742974 100644
--- a/pages/650/HBY650.vue
+++ b/pages/650/HBY650.vue
@@ -1051,7 +1051,7 @@ import request, { baseURL } from '@/utils/request.js';
var gotoCutImg = (imgPath) => {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
// console.log("我收到裁剪后的图片了,感谢老铁," + data)
diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue
index feec97b..91addfe 100644
--- a/pages/670/HBY670.vue
+++ b/pages/670/HBY670.vue
@@ -1871,7 +1871,7 @@
var gotoCutImg = (imgPath) => {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
// console.log("我收到裁剪后的图片了,感谢老铁," + data)
diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue
index d7021ca..0daf510 100644
--- a/pages/7305/BJQ7305.vue
+++ b/pages/7305/BJQ7305.vue
@@ -783,7 +783,7 @@
sourceType: ['album'],
success: function(res) {
uni.navigateTo({
- url: "/pages/6155/ImgCrop",
+ url: "/pages/ImgCrop/ImgCrop",
events: {
ImgCutOver: function(data) {
//将8位的二进制数组转换成16进制数据
diff --git a/pages/common/ImgCrop/ImgCrop.vue b/pages/common/ImgCrop/ImgCrop.vue
new file mode 100644
index 0000000..0f68d84
--- /dev/null
+++ b/pages/common/ImgCrop/ImgCrop.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/6170/callPolice/index.vue b/pages/common/callPolice/index.vue
similarity index 71%
rename from pages/6170/callPolice/index.vue
rename to pages/common/callPolice/index.vue
index 0f3dec1..7a11efb 100644
--- a/pages/6170/callPolice/index.vue
+++ b/pages/common/callPolice/index.vue
@@ -1,497 +1,584 @@
-
-
-
- 全选
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue
index 4c7b7b2..d384bde 100644
--- a/pages/common/index/index.vue
+++ b/pages/common/index/index.vue
@@ -18,13 +18,16 @@
-
-
-
+ 报警
+ 位置
+ 发送信息
+
+
+
@@ -40,15 +43,15 @@
设备:{{item.deviceName}}
- ID:{{item.deviceImei}}
+
+ ID:{{item.deviceImei}}
ID:{{item.deviceMac}}
- 在线
+ 在线
- 离线
+ 离线
电量:{{item.battery || '0'}}%
@@ -74,7 +77,7 @@
暂无数据
-->
-
+
@@ -116,7 +119,7 @@
-
+
{{ item.text }}
@@ -146,17 +149,34 @@
} from '@/api/common/index.js'
import bleTool from '@/utils/BleHelper.js';
import MescrollUni from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.vue'
-import BleReceive from '@/utils/BleReceive';
+ import BleReceive from '@/utils/BleReceive';
var pagePath = 'pages/common/index';
var ble = null;
var timeout = null;
- var recei=null;
+ var recei = null;
export default {
components: {
MescrollUni
},
-
+ computed:{
+ showSendFlex(){
+ // return this.activeTab && this.activeTab.id !== ''&& (this.activeTabInfo.communicationMode==0 || this.activeTabInfo.communicationMode==2);
+ if(this.showMap || this.ShowSendmessage || this.showWarn){
+ return true;
+ }
+ return false;
+ },
+ ShowSendmessage(){
+ return this.dic.showMsgTypes.indexOf(this.activeTabInfo.typeName)>-1
+ },
+ showMap(){
+ return this.dic.showMapTypes.indexOf(this.activeTabInfo.typeName)>-1
+ },
+ showWarn(){
+ return this.dic.showCallPolice.indexOf(this.activeTabInfo.typeName)>-1
+ }
+ },
data() {
return {
mescroll: null,
@@ -187,8 +207,7 @@ import BleReceive from '@/utils/BleReceive';
navTitle: "我的设备",
deleteShow: false,
RenameModel: false,
- menuItems: [
- {
+ menuItems: [{
text: '扫一扫添加',
icon: '/static/images/common/scane.png',
action: 'scan'
@@ -233,7 +252,12 @@ import BleReceive from '@/utils/BleReceive';
deviceId: '',
deviceName: "", //重命名
- activeTabInfo: ''
+ activeTabInfo: '',
+ dic: {
+ showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'],//需要发送消息的类型
+ showMapTypes:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y'],//需要显示地图的类型
+ showCallPolice:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y']//需要发送报警的类型
+ }
}
},
methods: {
@@ -254,7 +278,7 @@ import BleReceive from '@/utils/BleReceive';
// 下拉刷新
downCallback() {
-
+
if (this.mescroll) {
this.mescroll.resetUpScroll(false);
this.mescroll.scrollTo(0, 0);
@@ -266,7 +290,7 @@ import BleReceive from '@/utils/BleReceive';
// 上拉加载
upCallback() {
-
+
this.getData();
},
@@ -387,7 +411,7 @@ import BleReceive from '@/utils/BleReceive';
if (res.code == 200) {
//console.log("deviceTypeList=" + JSON.stringify(res.data));
this.tabs = [{
- id: '',
+ id: '',
name: '全部设备',
typeName: '全部设备'
},
@@ -412,7 +436,7 @@ import BleReceive from '@/utils/BleReceive';
getData() {
var task = () => {
-
+
return new Promise((resolve, reject) => {
let data = {
pageNum: this.mescroll.num,
@@ -496,9 +520,9 @@ import BleReceive from '@/utils/BleReceive';
case 'scan':
// 扫一扫
uni.navigateTo({
- url:'/pages/common/addScan/ScanEquip'
+ url: '/pages/common/addScan/ScanEquip'
});
-
+
break;
case 'bluetooth':
uni.navigateTo({
@@ -619,7 +643,7 @@ import BleReceive from '@/utils/BleReceive';
const deviceType = currentTab.id || '';
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
uni.navigateTo({
- url: '/pages/6170/callPolice/index',
+ url: '/pages/common/callPolice/index',
events: {
ack: function(data) {}
},
@@ -666,7 +690,7 @@ import BleReceive from '@/utils/BleReceive';
// 列表跳转
handleFile(item) {
let url = item.detailPageUrl;
- // url="/pages/6075/BJQ6075L";
+ // url="/pages/6075/BJQ6075L";
// if(!url){
// url="/pages/6075/BJQ6075"
// }
@@ -715,7 +739,7 @@ import BleReceive from '@/utils/BleReceive';
},
},
onShow() {
-
+
if (ble) {
//因为vue视图只能后退不能隐藏后再显示
//所以回到首页后将其他所有页面的订阅都删除
@@ -723,12 +747,12 @@ import BleReceive from '@/utils/BleReceive';
}
},
onLoad() {
-
+
// console.error("首页加载");
this.getTab()
this.downCallback();
-
-
+
+
// 绑定页面做了监听,新增成功,刷新页面
uni.$on('refreshDeviceList', () => {
this.getTab() // 刷新数据
@@ -771,9 +795,9 @@ import BleReceive from '@/utils/BleReceive';
recei.ReceiveData(receive, device, path, recArr);
this.updateBleStatu();
}, pagePath);
-
- let phone=uni.getStorageSync("phone");
- if(phone==='17671332251'){//先写死方便自己使用,后面按人员权限区分
+
+ let phone = uni.getStorageSync("phone");
+ if (phone === '17671332251') { //先写死方便自己使用,后面按人员权限区分
this.menuItems.push({
text: '上报设备',
icon: '/static/images/common/add.png',
diff --git a/pages/common/send/index.vue b/pages/common/send/index.vue
index f064c70..bd4d85c 100644
--- a/pages/common/send/index.vue
+++ b/pages/common/send/index.vue
@@ -1,11 +1,12 @@
-
-
+
+
+
-
+
@@ -27,7 +28,10 @@
-
+
+
+
+
编辑信息
-
\ No newline at end of file