From 9846fe2315eff7097b3a9d474286ee1a526cc9ae Mon Sep 17 00:00:00 2001 From: liub Date: Thu, 28 Aug 2025 14:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8A=A5=E8=AD=A6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 43 +- api/670/HBY670.js | 3 +- api/670/History.js | 55 ++ components/MessagePopup/MessagePopup.vue | 6 +- main.js | 6 +- manifest.json | 4 +- pages.json | 10 +- pages/670/HBY670.vue | 958 ++++++++++++++--------- pages/670/History.vue | 446 +++++++++++ pages/common/addBLE/LinkBle.vue | 34 +- pages/common/addBLE/addEquip.vue | 21 +- pages/common/index/index.vue | 6 + static/images/common/msg.png | Bin 0 -> 1592 bytes utils/BleHelper.js | 22 +- utils/BleReceive.js | 28 +- utils/loading.js | 8 +- utils/mqtt.js | 4 +- utils/request.js | 2 + 18 files changed, 1212 insertions(+), 444 deletions(-) create mode 100644 api/670/History.js create mode 100644 pages/670/History.vue create mode 100644 static/images/common/msg.png diff --git a/App.vue b/App.vue index c8dacb7..754e310 100644 --- a/App.vue +++ b/App.vue @@ -1,14 +1,46 @@ @@ -54,4 +86,9 @@ .uni-picker-view-wrapper{ background: rgba(42, 42, 42, 1); } + + @font-face { + font-family: "PingFang SC"; + src: url("~@/static/fonts/PingFangSC.ttf") format("opentype"); + } diff --git a/api/670/HBY670.js b/api/670/HBY670.js index 4cc35d3..f8fca9d 100644 --- a/api/670/HBY670.js +++ b/api/670/HBY670.js @@ -1,4 +1,4 @@ -import {request,baseURL} from '@/utils/request' +import request, { baseURL } from '@/utils/request' function getdata(data,url,method){ return new Promise((resolve,reject)=>{ @@ -14,6 +14,7 @@ function getdata(data,url,method){ method: method, data:data }).then((res)=>{ + console.log("res=",res); resolve(res); }).catch(ex=>{ reject(ex); diff --git a/api/670/History.js b/api/670/History.js new file mode 100644 index 0000000..be5ddfd --- /dev/null +++ b/api/670/History.js @@ -0,0 +1,55 @@ +import request, { baseURL } from '@/utils/request' + +function getdata(data,url,method){ + return new Promise((resolve,reject)=>{ + if(!url){ + reject('url为空'); + return; + } + if(!method){ + method='POST'; + } + request({ + url: url, + method: method, + data:data + }).then((res)=>{ + console.log("res=",res); + resolve(res); + }).catch(ex=>{ + console.log("ex=",ex); + reject(ex); + }); + }); + +} + + +//获取开关机数据 +function getSwithData(data){ + let url=""; + return getdata(data,url,"POST"); +} + +//报警信息 +function getWarnData(data){ + let url="" + return getdata(data,url,"POST"); +} + +//故障信息 +function getFaulData(data){ + let url="" + return getdata(data,url,"POST"); +} + +export default{ + getSwithData:getSwithData, + getWarnData:getWarnData, + getFaulData:getFaulData +} + + + + + diff --git a/components/MessagePopup/MessagePopup.vue b/components/MessagePopup/MessagePopup.vue index a5faf71..6b6cefc 100644 --- a/components/MessagePopup/MessagePopup.vue +++ b/components/MessagePopup/MessagePopup.vue @@ -177,17 +177,19 @@ export default { return styles[this.type][styleType] }, handleButtonClick() { - console.log('[MessagePopup] Button clicked with value:', this.inputValue) + this.$emit('buttonClick', this.inputValue) }, handleMaskClick() { - console.log('[MessagePopup] Mask clicked') + this.$emit('maskClick') }, closeClick(){ + this.$emit('closePop') }, handleCancelClick(){ + this.$emit('cancelPop'); }, handleInput(e) { diff --git a/main.js b/main.js index 42275af..1a815db 100644 --- a/main.js +++ b/main.js @@ -2,14 +2,14 @@ import App from './App' //// 引入 uView UI import uView from 'vk-uview-ui'; -import bleTool from '@/store/BLETools.js'; + // #ifndef VUE3 import Vue from 'vue' import store from './store/store'; import './uni.promisify.adaptor' Vue.config.productionTip = false -Vue.prototype.$bleTool = bleTool; + App.mpType = 'app' const app = new Vue({ store, @@ -25,7 +25,7 @@ import { } from 'vue' export function createApp() { const app = createSSRApp(App) - app.config.globalProperties.$bleTool = bleTool; + // 使用 uView UI app.use(uView) return { diff --git a/manifest.json b/manifest.json index 5a09c99..fd3db9d 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "JingQuan", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.0", + "versionName" : "1.0.9", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ @@ -85,7 +85,7 @@ "appkey_ios" : "065c43f02c7b627a74ad7dd23b16bb4f", "appkey_android" : "d7d852dbda2b95f6f796fb9a711a9fee" }, - "customStyle": true + "customStyle" : true }, "oauth" : {}, "push" : {} diff --git a/pages.json b/pages.json index 297bc18..cd0037d 100644 --- a/pages.json +++ b/pages.json @@ -265,7 +265,8 @@ { "path": "pages/670/HBY670", "style": { - "navigationBarTitleText": "HBY670" + "navigationBarTitleText": "HBY670", + "navigationStyle": "custom" } }, { @@ -273,6 +274,13 @@ "style": { "navigationBarTitleText": "HBY650" } + }, + { + "path" : "pages/670/History", + "style" : + { + "navigationBarTitleText" : "历史记录" + } } diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index ea422b6..39a6abc 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -1,6 +1,9 @@