同步用户信息调好了

This commit is contained in:
17792275749
2025-04-23 09:56:51 +08:00
parent 7554edfb93
commit a76176346f
5 changed files with 64 additions and 51 deletions
@@ -1,4 +1,5 @@
const app = getApp();
import $ from "../../utils/request";
Page({
data: {
@@ -58,35 +59,35 @@ Page({
let userInfo = this.data.userInfo;
let i = this.data.subUser.i;
let subUser = this.data.subUser.data;
app.globalData.ppScale.activeProtocol.dataSyncUserInfo({
userID: userInfo.id,
userName: subUser[i].realname,
memberID: subUser[i].id,
age: this.getAge(subUser[i].birthday), //
gender: subUser[i].sex, //
height: subUser[i].height, //
isAthleteMode: 0,
currentWeight: subUser[i].weight, //
deviceHeaderIndex: 0,
targetWeight: "",
idealWeight: "",
recentData: [],
}, (res) => {
console.log("dataSyncSubUserInfo", res);
if(i < subUser.length) {
if(i < subUser.length) {
app.globalData.ppScale.activeProtocol.dataSyncUserInfo({
userID: userInfo.id,
userName: subUser[i].realname,
memberID: subUser[i].id,
age: this.getAge(subUser[i].birthday), //
gender: subUser[i].sex, //
height: subUser[i].height, //
isAthleteMode: 0,
currentWeight: subUser[i].weight, //
deviceHeaderIndex: 0,
targetWeight: "",
idealWeight: "",
recentData: [],
}, (res) => {
console.log("dataSyncSubUserInfo", res);
this.setData({
['subUser.i']: i + 1
})
this.setSubUser();
} else {
this.resetDevice();
app.globalData.ppScale.plugin.Blue.stop();
wx.hideLoading();
wx.switchTab({
url: "/pages/home/home"
})
}
})
})
} else {
this.resetDevice();
app.globalData.ppScale.plugin.Blue.stop();
wx.hideLoading();
wx.switchTab({
url: "/pages/home/home"
})
}
},
resetDevice() {