app.json的配置:
当前页面的json:
问题在app.js,但我看不出哪出问题,删了就正常了
var e = require("@babel/runtime/helpers/interopRequireDefault"), t = e(require("./baseModel")), a = e(require("./utils/bluetooth")), l = e(require("./utils/qxbluetooth")), o = new t.default(), n = new a.default(), i = new l.default();
App({
onLaunch: function() {
o.extendDateFunc(), this.versionUpdate(), wx.closeBluetoothAdapter();
},
onHide: function() {
var e = this;
e.globalData.canClose = !0, console.log("隐藏"), clearTimeout(e.globalData.timer1),
e.globalData.timer1 = null, e.globalData.deviceId && (e.globalData.timer1 = setTimeout(function() {
e.globalData.canClose && (clearInterval(e.globalData.timer), e.globalData.timer = null,
e.globalData.canwrite = !1);
}, 4e4)), this.globalData.canCloseblue && (n.closeConnectBluetooth(this.globalData.deviceId),
clearInterval(e.globalData.timer), e.globalData.timer = null, e.globalData.canwrite = !1);
},
onShow: function() {
var e = this;
this.globalData.canClose = !1, this.globalData.canCloseblue = !0;
var t = wx.getStorageSync("yuangong");
0 == t && this.globalData.deviceId && !this.globalData.blueconnected && (this.globalData.bluewarntext = "蓝牙已断开",
e.globalData.firstonload || (e.globalData.canwrite = !0,
this.globalData.bluewarntext = "正在搜索设备", setTimeout(function() {
2 == e.globalData.blueType ? i.initBluetooth(e.globalData.blueName) : n.initBluetooth(e.globalData.blueName);
}, 3500)));
},
versionUpdate: function() {
var e = wx.getUpdateManager();
e.onCheckForUpdate(function(e) {
console.log(e.hasUpdate);
}), e.onUpdateReady(function() {
wx.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?",
success: function(t) {
t.confirm && e.applyUpdate();
}
});
}), e.onUpdateFailed(function() {
wx.showModal({
title: "更新提示",
content: "新版本下载失败",
showCancel: !1
});
});
},
watch: function(e) {
var t = this.globalData;
Object.defineProperty(t, "bluewarntext", {
configurable: !0,
enumerable: !0,
set: function(t) {
e(t);
},
get: function() {
return this.globalData;
}
});
},
watchchart: function(e) {
var t = this.globalData;
Object.defineProperty(t, "haveChart", {
configurable: !0,
enumerable: !0,
set: function(t) {
e(t);
},
get: function() {
return this.globalData;
}
});
},
watpercent: function(e) {
var t = this.globalData;
Object.defineProperty(t, "percent", {
configurable: !0,
enumerable: !0,
set: function(t) {
e(t);
},
get: function() {
return this.globalData;
}
});
},
watbluetof: function(e) {
var t = this.globalData;
Object.defineProperty(t, "bluetof", {
configurable: !0,
enumerable: !0,
set: function(t) {
e(t);
},
get: function() {
return this.globalData;
}
});
},
watchopenlocation: function(e) {
var t = this.globalData;
Object.defineProperty(t, "openlocation", {
configurable: !0,
enumerable: !0,
set: function(t) {
e(t);
},
get: function() {
return this.globalData;
}
});
},
globalData: {
percent: 0,
time1: "",
time2: "",
time3: "",
time4: "",
time5: "",
firstBuff: [],
timeBuff: [],
timer: null,
timer1: null,
cabinet_id: "",
openblue: !1,
bluetof: !1,
openlocation: !1,
blueconnected: !1,
canClose: !1,
firstonload: !1,
canCloseblue: !0,
canwrite: !0,
bluewarntext: "",
haveChart: 3.9,
cabinet_chart: 3.9,
blueName: 164154859731,
deviceId: "",
writeServicweId: "",
writeCharacteristicsId: "",
isbluetg: null,
blue2g: "",
goodlist: [],
productType: "cabinet",
opentype: "",
chargeLineId: null,
dryerId: null,
timetimer: null,
sendNums: 1,
blueType: "0",
fromcode: null,
needCharge: !1,
haveLink: !1,
mtid: null,
pulldownxcx: !1,
sheight: null,
ChargeType: 2
},
setting: {}
});
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。