添加消息推送云函数、消息处理为后续的消息通知做准备

This commit is contained in:
liub
2026-02-24 15:39:58 +08:00
parent db8f14525b
commit 2f871ac5cf
43 changed files with 6555 additions and 80 deletions

View File

@ -116,7 +116,7 @@
<view class="tooltip-content" @click.stop>
<view class="tooltip-item" v-for="(item, index) in menuItems" :key="index"
@click="handleMenuClick(item)">
<image :src="item.icon" class="item-icon" />
<image :src="item.icon" class="item-icon" mode="aspectFit"/>
<text>{{ item.text }}</text>
</view>
</view>
@ -243,9 +243,9 @@ import BleReceive from '@/utils/BleReceive';
// 底部 footer 高度约 220rpx + 120rpx = 340rpx转换为 px1rpx = sysInfo.pixelRatio / 750 * 屏幕宽度?不,直接用 rpx 转 px 公式)
let footerHeight = 340 * (sysInfo.screenWidth / 750); // rpx 转 px
console.log("footerHeight=", footerHeight);
// console.log("footerHeight=", footerHeight);
this.mescrollHeight = sysInfo.screenHeight - footerHeight;
console.log("mescrollHeight=", this.mescrollHeight);
// console.log("mescrollHeight=", this.mescrollHeight);
},
mescrollInit(mescroll) {
this.mescroll = mescroll;
@ -253,7 +253,7 @@ import BleReceive from '@/utils/BleReceive';
// 下拉刷新
downCallback() {
console.log("下拉加载")
if (this.mescroll) {
this.mescroll.resetUpScroll(false);
this.mescroll.scrollTo(0, 0);
@ -265,7 +265,7 @@ import BleReceive from '@/utils/BleReceive';
// 上拉加载
upCallback() {
console.log("上拉加载")
this.getData();
},
@ -414,7 +414,7 @@ import BleReceive from '@/utils/BleReceive';
getData() {
var task = () => {
console.error("正在加载第" + this.mescroll.num + "页数据");
return new Promise((resolve, reject) => {
let data = {
pageNum: this.mescroll.num,
@ -500,60 +500,18 @@ import BleReceive from '@/utils/BleReceive';
uni.navigateTo({
url:'/pages/common/addScan/ScanEquip'
});
// uni.scanCode({
// autoDecodeCharset:true,
// autoZoom:true,
// barCodeInput:true,
// success: (res) => {
// console.log('条码内容:', res);
// // 清除之前的数据
// this.previousScanResult = null;
// // 处理新的扫码结果
// const cleanedResult = res.result.trim();
// console.log('扫码结果:', cleanedResult);
// let url =
// `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`;
// try {
// let json = JSON.parse(cleanedResult);
// if ('imei' in json) {
// url =
// `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(json.imei)}`;
// } else if ('blue' in json || 'ble' in json) {
// if(json.ble){
// json.blue=json.ble;
// }
// if(json.blue){
// if (!json.blue.includes(':')) {
// json.blue = json.blue.replace(
// /(.{2})/g, '$1:')
// .slice(0, -1)
// }
// }
// url =`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
// }
// } catch (ex) {
// }
// // 跳转并传递扫描结果
// uni.navigateTo({
// url: url
// });
// },
// fail: (err) => {
// console.log('扫码失败', err);
// uni.showToast({
// title: '扫码失败',
// icon: 'none'
// });
// }
// });
break;
case 'bluetooth':
uni.navigateTo({
url: "/pages/common/addBLE/addEquip"
})
break;
case "add":
uni.navigateTo({
url: "/pages/common/addDevice/TypeList"
})
break;
}
},
// 右滑点击事件处理
@ -768,9 +726,11 @@ import BleReceive from '@/utils/BleReceive';
},
onLoad() {
console.error("首页加载");
// console.error("首页加载");
this.getTab()
this.downCallback();
// 绑定页面做了监听,新增成功,刷新页面
uni.$on('refreshDeviceList', () => {
this.getTab() // 刷新数据
@ -813,7 +773,15 @@ import BleReceive from '@/utils/BleReceive';
recei.ReceiveData(receive, device, path, recArr);
this.updateBleStatu();
}, pagePath);
let phone=uni.getStorageSync("phone");
if(phone==='17671332251'){//先写死方便自己使用,后面按人员权限区分
this.menuItems.push({
text: '上报设备',
icon: '/static/images/common/add.png',
action: 'add'
});
}
this.getSystemInfoSyncH();
},