|
@@ -7,6 +7,7 @@ Page({
|
|
userInfo: {},
|
|
userInfo: {},
|
|
waterInfo: {},
|
|
waterInfo: {},
|
|
onQuery: true,
|
|
onQuery: true,
|
|
|
|
+ unAuth:false,
|
|
items: [{
|
|
items: [{
|
|
id: 'realtimewater',
|
|
id: 'realtimewater',
|
|
label: '用水量',
|
|
label: '用水量',
|
|
@@ -72,8 +73,11 @@ Page({
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
that.setData({
|
|
that.setData({
|
|
- weixinLogin:true
|
|
|
|
|
|
+ weixinLogin:true,
|
|
|
|
+ onQuery:false
|
|
})
|
|
})
|
|
|
|
+ console.log("weixinLogin:"+that.data.weixinLogin)
|
|
|
|
+ console.log("onQuery:"+that.data.onQuery)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// 绑定成功未注册
|
|
// 绑定成功未注册
|
|
@@ -89,6 +93,14 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ else{
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '您尚未注册,请到平台端开通账号后重试',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
gotopage(e) {
|
|
gotopage(e) {
|
|
const {
|
|
const {
|
|
@@ -117,33 +129,38 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getAccountInfo() {
|
|
getAccountInfo() {
|
|
|
|
+ let _self=this
|
|
this.setData({
|
|
this.setData({
|
|
- onQuery: true
|
|
|
|
- })
|
|
|
|
|
|
+ onQuery:true,
|
|
|
|
+ unAuth:false
|
|
|
|
+ })
|
|
app.$util.selfUserInfo(app.globalData, true).then((data) => {
|
|
app.$util.selfUserInfo(app.globalData, true).then((data) => {
|
|
if (data) {
|
|
if (data) {
|
|
this.setData({
|
|
this.setData({
|
|
userInfo: data,
|
|
userInfo: data,
|
|
waterInfo: data.waterStages
|
|
waterInfo: data.waterStages
|
|
|
|
+ })
|
|
|
|
+ _self.setData({
|
|
|
|
+ onQuery:false
|
|
})
|
|
})
|
|
|
|
+ console.log("_self.onQuery:" + _self.data.onQuery)
|
|
} else {
|
|
} else {
|
|
this.setData({
|
|
this.setData({
|
|
userInfo: {},
|
|
userInfo: {},
|
|
waterInfo: {}
|
|
waterInfo: {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- this.setData({
|
|
|
|
- onQuery: false
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- this.setData({
|
|
|
|
- onQuery: false
|
|
|
|
|
|
+ _self.setData({
|
|
|
|
+ onQuery:false
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取用户注册状态 /user/getUser
|
|
// 获取用户注册状态 /user/getUser
|
|
isRegister(){
|
|
isRegister(){
|
|
let that=this;
|
|
let that=this;
|
|
|
|
+ that.setData({unAuth:false})
|
|
app.$http.postForm('/appletUser/getUser').then(({ status, msg, data }) => {
|
|
app.$http.postForm('/appletUser/getUser').then(({ status, msg, data }) => {
|
|
// 已授权但客户不存在
|
|
// 已授权但客户不存在
|
|
// 未授权
|
|
// 未授权
|
|
@@ -156,13 +173,25 @@ Page({
|
|
weixinLogin:true
|
|
weixinLogin:true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ else if(status===-406)
|
|
|
|
+ {
|
|
|
|
+ that.setData({
|
|
|
|
+ weixinLogin:false,
|
|
|
|
+ unAuth:true
|
|
|
|
+ })
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '您尚未注册认证,请到平台端开通账号后重试',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onShow() {
|
|
|
|
|
|
+ onShow() {
|
|
let _self=this
|
|
let _self=this
|
|
this.getAccountInfo();
|
|
this.getAccountInfo();
|
|
this.isRegister()
|
|
this.isRegister()
|
|
-
|
|
|
|
},
|
|
},
|
|
toLogin(msg) {
|
|
toLogin(msg) {
|
|
this.popup && this.popup.setData({
|
|
this.popup && this.popup.setData({
|