同步用户信息调好了
This commit is contained in:
@@ -12,7 +12,7 @@ App({
|
|||||||
ppScale: {
|
ppScale: {
|
||||||
plugin: null,
|
plugin: null,
|
||||||
activeProtocol: null,
|
activeProtocol: null,
|
||||||
// domain: "https://device.shuziweidao.com/gateway",
|
// domain: "http://device.shuziweidao.com/gateway",
|
||||||
domain: "http://192.168.10.173:8889",
|
domain: "http://192.168.10.173:8889",
|
||||||
wifi: {
|
wifi: {
|
||||||
ssid: "",
|
ssid: "",
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
"style": "v2",
|
"style": "v2",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"ppScale-plugin": {
|
"ppScale-plugin": {
|
||||||
"version": "0.0.11",
|
"version": "1.2.15",
|
||||||
"provider": "wx0826af4e4908f524"
|
"provider": "wx0ffb48417ce6345c"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sitemapLocation": "sitemap.json",
|
"sitemapLocation": "sitemap.json",
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="btn">
|
<view class="btn" bind:tap="openUserInfo">
|
||||||
<view>
|
<view>
|
||||||
<image src="/images/familyMembers/add.png" />
|
<image src="/images/familyMembers/add.png" />
|
||||||
</view>
|
</view>
|
||||||
<view bind:tap="openUserInfo">添加新成员</view>
|
<view>添加新成员</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -10,6 +10,7 @@ Page({
|
|||||||
ssid: options.ssid,
|
ssid: options.ssid,
|
||||||
password: options.password
|
password: options.password
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
|
if(res === 23) {
|
||||||
app.globalData.ppScale.wifi.ssid = ssid;
|
app.globalData.ppScale.wifi.ssid = ssid;
|
||||||
app.globalData.ppScale.wifi.password = password;
|
app.globalData.ppScale.wifi.password = password;
|
||||||
|
|
||||||
@@ -52,6 +53,17 @@ Page({
|
|||||||
})
|
})
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "配网失败,错误码:" + res
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.switchTab({
|
||||||
|
url: "/pages/home/home"
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const app = getApp();
|
const app = getApp();
|
||||||
|
import $ from "../../utils/request";
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
@@ -58,6 +59,7 @@ Page({
|
|||||||
let userInfo = this.data.userInfo;
|
let userInfo = this.data.userInfo;
|
||||||
let i = this.data.subUser.i;
|
let i = this.data.subUser.i;
|
||||||
let subUser = this.data.subUser.data;
|
let subUser = this.data.subUser.data;
|
||||||
|
if(i < subUser.length) {
|
||||||
app.globalData.ppScale.activeProtocol.dataSyncUserInfo({
|
app.globalData.ppScale.activeProtocol.dataSyncUserInfo({
|
||||||
userID: userInfo.id,
|
userID: userInfo.id,
|
||||||
userName: subUser[i].realname,
|
userName: subUser[i].realname,
|
||||||
@@ -73,11 +75,11 @@ Page({
|
|||||||
recentData: [],
|
recentData: [],
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
console.log("dataSyncSubUserInfo", res);
|
console.log("dataSyncSubUserInfo", res);
|
||||||
if(i < subUser.length) {
|
|
||||||
this.setData({
|
this.setData({
|
||||||
['subUser.i']: i + 1
|
['subUser.i']: i + 1
|
||||||
})
|
})
|
||||||
this.setSubUser();
|
this.setSubUser();
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.resetDevice();
|
this.resetDevice();
|
||||||
app.globalData.ppScale.plugin.Blue.stop();
|
app.globalData.ppScale.plugin.Blue.stop();
|
||||||
@@ -86,7 +88,6 @@ Page({
|
|||||||
url: "/pages/home/home"
|
url: "/pages/home/home"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
resetDevice() {
|
resetDevice() {
|
||||||
|
|||||||
Reference in New Issue
Block a user