业主绑定和开发处理完成

This commit is contained in:
wuxw 2019-12-30 22:29:32 +08:00
parent 366e067c4e
commit 68bdc82555
4 changed files with 22 additions and 9 deletions

View File

@ -19,23 +19,25 @@ class LoginFactory {
// 检查本地 storage 中是否有登录态标识
checkLoginStatus(callback = () => { }) {
let _that = this;
let loginFlag = wx.getStorageSync(constant.mapping.LOGIN_FLAG);
if (loginFlag) {
// 检查 session_key 是否过期
wx.checkSession({
// session_key 有效(为过期)
success: function () {
console.log('判断用户是否登录');
callback();
},
// session_key 过期
fail: function () {
// session_key过期
this.doLogin();
_that.doLogin();
}
});
} else {
// 无登录态
this.doLogin(callback);
_that.doLogin(callback);
}
}

View File

@ -161,7 +161,7 @@ Page({
success: function (res) {
console.log(res);
//成功情况下跳转
wx.navigateTo({
wx.redirectTo({
url: "/pages/viewBindOwner/viewBindOwner"
});
},

View File

@ -21,10 +21,14 @@ Page({
},
onShow: function() {
let that = this;
that.setData({
console.log('show 方法被调用');
let _that = this;
//查询用户信息
_that.loadOwenrInfo();
_that.setData({
userInfo: context.getUserInfo()
});
},
bindingOwner:function(){
wx.navigateTo({

View File

@ -1,5 +1,6 @@
// pages/viewBindOwner/viewBindOwner.js
const context = require("../../context/Java110Context.js");
const constant = context.constant;
Page({
/**
@ -132,9 +133,17 @@ Page({
data: obj, //动态数据
success: function (res) {
console.log(res);
if(res.statusCode != 200){
wx.showToast({
title: '解绑失败',
icon:'none',
duration:2000
});
return ;
}
//成功情况下跳转
wx.navigateTo({
url: "/pages/viewBindOwner/viewBindOwner"
wx.redirectTo({
url: "/pages/bindOwner/bindOwner"
});
},
fail: function (e) {
@ -146,6 +155,4 @@ Page({
}
});
}
}
})