feat(设备管理): 重构设备数据管理逻辑,统一使用deviceData对象

- 将分散的设备信息存储改为统一的deviceData对象
- 更新相关API请求参数传递方式
- 增加设备类型支持,动态构建API路径
- 修复设备信息初始化问题,确保数据一致性
This commit is contained in:
2025-06-25 12:43:31 +08:00
parent ea5ed7c9ce
commit fec4276cc8
7 changed files with 45 additions and 27 deletions

19
app.js
View File

@@ -21,15 +21,13 @@ App({
// 上报地址
LOG_URL: 'https://t-jm.v0750.com/v2/stat/send',
},
onLaunch: function(e) {
onLaunch: function (e) {
// 40 位的随机码
if (!wx.getStorageSync("session")) {
wx.setStorageSync("session", generateRandomCode(40));
}
console.log("options", e), this.globalData.options = e, t.getLogin(this, !0);
try {
var o = wx.getSystemInfoSync();
@@ -43,16 +41,16 @@ App({
});
}
},
onShow: function(e) {
onShow: function (e) {
console.log("onshowwwwwwwoptions", e);
var o = e.scene;
[ 1011, 1012, 1013, 1024, 1047, 1048, 1049 ].indexOf(o) > -1 && (console.log("扫码进入的"),
t.getDevicecode(this, e));
[1011, 1012, 1013, 1024, 1047, 1048, 1049].indexOf(o) > -1 && (console.log("扫码进入的"),
t.getDevicecode(this, e));
},
computeNavigateBarHeight: function(t) {
computeNavigateBarHeight: function (t) {
var e = wx.getMenuButtonBoundingClientRect(), o = e.bottom + 6, i = t.windowHeight, n = e.top, a = e.height;
i < 10 && (i = t.windowHeight, a = o - (n = t.statusBarHeight)), o < 10 && (console.log("更新"),
o = 68, /iPhone X|MI 8|PAAM00|COR-AL00/.test(t.model) ? o = 88 : /iPhone/.test(t.model) && (o = 64));
o = 68, /iPhone X|MI 8|PAAM00|COR-AL00/.test(t.model) ? o = 88 : /iPhone/.test(t.model) && (o = 64));
var s = t.windowWidth;
this.globalData.screen_data = {
windowWidth: s,
@@ -76,6 +74,11 @@ App({
isneedUpload: !1,
needJumpUrl: !1,
devicecode: "",
deviceData: {
type: 'machine',
devicecode: '',
options: {}
},
protocol: {},
tips: ""
}