2025年4月2日17:58:50
This commit is contained in:
@@ -8,13 +8,6 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
let name = app.globalData.ppScale.device.name;
|
||||
let deviceSelect = app.globalData.ppScale.device.connection;
|
||||
this.setData({
|
||||
name: name ? name : deviceSelect.name,
|
||||
deviceSelect: deviceSelect
|
||||
})
|
||||
|
||||
app.globalData.ppScale.plugin.bus.subscribe("deviceConnect", (res) => {
|
||||
console.log('connectedDevice ===》deviceConnect', res);
|
||||
|
||||
@@ -65,7 +58,7 @@ Page({
|
||||
})
|
||||
} else {
|
||||
app.globalData.ppScale.device.name = this.data.name;
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: "/pages/connectionSuccessful/connectionSuccessful"
|
||||
})
|
||||
}
|
||||
@@ -74,6 +67,14 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
let deviceSelect = app.globalData.ppScale.device.connection;
|
||||
this.setData({
|
||||
name: deviceSelect.name,
|
||||
deviceSelect: deviceSelect
|
||||
})
|
||||
},
|
||||
|
||||
nameInput(e) {
|
||||
this.setData({
|
||||
name: e.detail.value
|
||||
@@ -90,6 +91,7 @@ Page({
|
||||
title: "蓝牙配对中...",
|
||||
mask: true
|
||||
});
|
||||
app.globalData.ppScale.device.name = name;
|
||||
app.globalData.ppScale.plugin.Blue.createBLEConnection(deviceSelect);
|
||||
} else {
|
||||
wx.showToast({
|
||||
|
||||
Reference in New Issue
Block a user