diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 5f99f6f..7181f97 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,13 +2,23 @@ "version" : "1.0", "configurations" : [ { - "playground" : "standard", + "playground" : "custom", "type" : "uni-app:app-ios" }, { "customPlaygroundType" : "local", - "playground" : "standard", + "playground" : "custom", "type" : "uni-app:app-android" + }, + { + "app" : { + "launchtype" : "remote" + }, + "default" : { + "launchtype" : "local" + }, + "provider" : "aliyun", + "type" : "uniCloud" } ] } diff --git a/App.vue b/App.vue index 35e20f9..d01ee49 100644 --- a/App.vue +++ b/App.vue @@ -29,19 +29,55 @@ // uni.clearStorageSync(); //以上代码仅在开发时使用,否则会出现不可预知的问题。 - // #ifdef APP-PLUS + // #ifdef APP|APP-PLUS + + bleTool.getBleTool(); + var appid = plus.runtime.appid; console.log('应用的 appid 为:' + appid); + + + 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; + } + 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 }, onShow: function() { console.log('App Show'); - + //将检查更新换到onshow,因为苹果用户喜欢一直挂着 uni.getSystemInfo({ success: function(res) { if (res.uniPlatform == 'app') { - bleTool.getBleTool(); + let appid = plus.runtime.appid; if (appid !== 'HBuilder') { console.log("appid=", appid); @@ -55,7 +91,7 @@ console.log('App Hide'); }, onError(ex) { - console.error("出现了未知的异常",ex); + console.error("出现了未知的异常", ex); } } @@ -152,7 +188,8 @@ .displayNone { display: none !important; } - .visibilityHidden{ + + .visibilityHidden { visibility: hidden !important; } diff --git a/androidPrivacy.json b/androidPrivacy.json index 6e900af..3e91c29 100644 --- a/androidPrivacy.json +++ b/androidPrivacy.json @@ -2,7 +2,7 @@ "version" : "1", "prompt" : "template", "title" : "服务协议和隐私政策", - "message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  你可阅读《服务协议》《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。", + "message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  你可阅读《服务协议》《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。", "buttonAccept" : "同意并接受", "buttonRefuse" : "暂不同意", "hrefLoader" : "system", diff --git a/api/6170/callPolice.js b/api/6170/callPolice.js index 88a5e01..ccbac70 100644 --- a/api/6170/callPolice.js +++ b/api/6170/callPolice.js @@ -6,4 +6,8 @@ export function deviceSendAlarmMessage(data) { method: 'post', data: data }) +} + +export function deviceDefaultAlarm(data){ + return Promise.reject(data); } \ No newline at end of file diff --git a/components/MessagePopup/MessagePopup.vue b/components/MessagePopup/MessagePopup.vue index 46291b3..8f3a628 100644 --- a/components/MessagePopup/MessagePopup.vue +++ b/components/MessagePopup/MessagePopup.vue @@ -48,7 +48,7 @@ {{ buttonCancelText?buttonCancelText:'取消' }} diff --git a/components/MsgBox/MsgBox.vue b/components/MsgBox/MsgBox.vue new file mode 100644 index 0000000..77e99f1 --- /dev/null +++ b/components/MsgBox/MsgBox.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/config/index.js b/config/index.js index 31d9e3c..d8101c0 100644 --- a/config/index.js +++ b/config/index.js @@ -2,7 +2,7 @@ const config = { // 开发环境 development: { - BASE_URL: 'http://192.168.2.34:8000',//http://139.224.253.23:8000 + BASE_URL: 'http://192.168.110.172:8000',//http://139.224.253.23:8000 API_PREFIX: '', // MQTT 配置 MQTT_HOST: '47.120.79.150', diff --git a/manifest.json b/manifest.json index d9ccd8e..c0b6df4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "星汉物联", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.15", + "versionName" : "1.0.18", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ @@ -27,7 +27,8 @@ "Geolocation" : {}, "Maps" : {}, "Record" : {}, - "VideoPlayer" : {} + "VideoPlayer" : {}, + "Push" : {} }, /* 应用发布信息 */ "distribute" : { @@ -99,7 +100,8 @@ }, "push" : { "unipush" : { - "offline" : false + "version" : "2", + "offline" : true } } }, @@ -165,7 +167,12 @@ }, "vueVersion" : "2", "locale" : "zh-Hans", - "fallbackLocale" : "zh-Hans" + "fallbackLocale" : "zh-Hans", + "app-harmony" : { + "distribute" : { + "modules" : {} + } + } } /* 5+App特有相关 */ diff --git a/pages.json b/pages.json index 8ee4097..8002641 100644 --- a/pages.json +++ b/pages.json @@ -414,9 +414,33 @@ { "navigationBarTitleText" : "录制语音" } + }, + { + "path" : "pages/common/addScan/ScanEquip", + "style" : + { + "navigationBarTitleText" : "扫码", + "navigationStyle": "custom" + } + }, + { + "path": "pages/common/addDevice/TypeList", + "style": { + "navigationBarTitleText": "设备类型" + } + }, + { + "path": "pages/common/addDevice/addImei", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/common/addDevice/addBle", + "style": { + "navigationBarTitleText": "蓝牙添加设备" + } } - - ], "tabBar": { diff --git a/pages/018A/HBY018A.vue b/pages/018A/HBY018A.vue index bcb5419..3d5fb41 100644 --- a/pages/018A/HBY018A.vue +++ b/pages/018A/HBY018A.vue @@ -505,7 +505,11 @@ return; } if (res.deviceId == these.formData.deviceId) { - this.formData.bleStatu = false; + if(res.device){ + these.formData.bleStatu = 'connecting'; + }else{ + this.formData.bleStatu = false; + } setTimeout(() => { hideLoading(these, 1000); }); diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index eff28dd..ea99012 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -57,9 +57,9 @@ 蓝牙名称 {{device.bluetoothName}} - + 蓝牙状态 - {{formData.bleStatu?'已连接':'未连接'}} + {{getbleStatu}}