处理636的兼容
This commit is contained in:
+39
-3
@@ -25,13 +25,49 @@ Page({
|
||||
url: "/pages/userInfo/userInfo?initBluetooth=1&customerType=1"
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: "请先登录"
|
||||
wx.login({
|
||||
success: (res) => {
|
||||
if (res.code) {
|
||||
this.checkOpenIdLogin(res.code);
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: "登录失败,请稍后再试!",
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 微信一键登录
|
||||
checkOpenIdLogin(code) {
|
||||
let params = {
|
||||
code: code
|
||||
};
|
||||
$.ajax("weighingScale/checkOpenIdLogin", params, "POST", true, "登录中...").then((res) => {
|
||||
wx.setStorageSync("userInfo", res.result.user);
|
||||
wx.setStorageSync("token", res.result.token);
|
||||
if(res.result.token && res.result.user) {
|
||||
this.setData({
|
||||
token: res.result.token,
|
||||
userInfo: res.result.user
|
||||
})
|
||||
this.getDevice();
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: "请先补全个人信息"
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({
|
||||
url: "/pages/userInfo/userInfo?initBluetooth=0&customerType=1"
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 打开设备详情
|
||||
openDeviceInfo() {
|
||||
if(this.data.userInfo) {
|
||||
|
||||
Reference in New Issue
Block a user