同步用户信息调好了
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user