|
|
@@ -1,26 +1,33 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view class="head"> |
|
|
|
<image class="head-immg" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/login.png" mode=""></image> |
|
|
|
<image class="head-immg" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/login.png" mode=""> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
<view class="input"> |
|
|
|
<view class="cwjs-cells item-flex"> |
|
|
|
<view class="cwjs-item center"> |
|
|
|
<image src="https://qufang.oss-cn-beijing.aliyuncs.com/channelHelper/user.png" class="logo_input"> |
|
|
|
</image> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" v-model="username" placeholder="请输入账号名" type="number" maxlength="11" placeholder-style="color:#AAAAAA"/> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" v-model="username" |
|
|
|
placeholder="请输入账号名" type="number" maxlength="11" placeholder-style="color:#AAAAAA" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="cwjs-cells item-flex" style="margin-top:13rpx;"> |
|
|
|
<view class="cwjs-item center"> |
|
|
|
<image src="https://qufang.oss-cn-beijing.aliyuncs.com/channelHelper/lock.png" class="logo_input"> |
|
|
|
</image> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" placeholder="请输入密码" placeholder-style="color:#AAAAAA" type="password" v-model="password" maxlength="16" v-if="passwordType"/> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" placeholder="请输入密码" placeholder-style="color:#AAAAAA" maxlength="16" v-model="password" v-else/> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" placeholder="请输入密码" |
|
|
|
placeholder-style="color:#AAAAAA" type="password" v-model="password" maxlength="16" |
|
|
|
v-if="passwordType" /> |
|
|
|
<input class="cwjs-item cwjs-input" style="font-size: 36rpx;" placeholder="请输入密码" |
|
|
|
placeholder-style="color:#AAAAAA" maxlength="16" v-model="password" v-else /> |
|
|
|
</view> |
|
|
|
<view class="imagesBox" @tap="changeBindPassword"> |
|
|
|
<image v-if="passwordType==false" src="../../static/images/zhengkai.png" class="images" mode="scaleToFill"></image> |
|
|
|
<image v-if="passwordType==true" src="../../static/images/bishang.png" class="images" mode="scaleToFill"></image> |
|
|
|
<image v-if="passwordType==false" src="../../static/images/zhengkai.png" class="images" |
|
|
|
mode="scaleToFill"></image> |
|
|
|
<image v-if="passwordType==true" src="../../static/images/bishang.png" class="images" |
|
|
|
mode="scaleToFill"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="textbox"> |
|
|
@@ -41,8 +48,8 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
username: '',//18831048327 ,18888888800 |
|
|
|
password: '',//123456 |
|
|
|
username: '', //18831048327 ,18888888800 |
|
|
|
password: '', //123456 |
|
|
|
passwordType: true, |
|
|
|
agreeChecked: true |
|
|
|
}; |
|
|
@@ -65,7 +72,7 @@ |
|
|
|
}, |
|
|
|
//密码选择 |
|
|
|
changeBindPassword: function(e) { |
|
|
|
this.passwordType=!this.passwordType; |
|
|
|
this.passwordType = !this.passwordType; |
|
|
|
}, |
|
|
|
//登录 |
|
|
|
bindWxBLogin: function(e) { |
|
|
@@ -82,7 +89,7 @@ |
|
|
|
var loginParams = { |
|
|
|
loginName: this.username, |
|
|
|
password: this.password |
|
|
|
}; |
|
|
|
}; |
|
|
|
// 请求服务器登录地址,获得会话信息 |
|
|
|
uni.request({ |
|
|
|
url: config.service.login, |
|
|
@@ -92,7 +99,7 @@ |
|
|
|
method: "POST", |
|
|
|
data: loginParams, |
|
|
|
success: function(result) { |
|
|
|
var data = result.data; |
|
|
|
var data = result.data; |
|
|
|
//console.log("登陆信息", data); |
|
|
|
if (data && data.code == 10000) { |
|
|
|
var res = data.data; |
|
|
@@ -107,7 +114,7 @@ |
|
|
|
} else { |
|
|
|
util.showNone("账号名或密码错误,请重试"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
// 没有正确响应会话信息 |
|
|
|
} else { |
|
|
|
util.showNone(data.message); |
|
|
@@ -121,33 +128,41 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
getUser(){ |
|
|
|
getUser() { |
|
|
|
util.getRequestPromise(config.service.getUser, {}, false, "GET").then(data => { |
|
|
|
let arr = [] |
|
|
|
if (data.zkProperties) { |
|
|
|
|
|
|
|
arr = data.zkProperties.filter(item => item.lockFlag != 1) |
|
|
|
console.log(arr) |
|
|
|
if (arr.length !== 0) { |
|
|
|
let lopan = { |
|
|
|
id: arr[0].id, |
|
|
|
name: arr[0].propertyName, |
|
|
|
...arr[0], |
|
|
|
} |
|
|
|
uni.setStorageSync("fendianindex", 0); //写入缓存 |
|
|
|
uni.setStorageSync("weapp_session_userInfo_data", data); //写入缓存 |
|
|
|
uni.setStorageSync("buildingID", lopan); //项目id写入缓存 |
|
|
|
this.$u.post('/user/addLoginCount', { |
|
|
|
houseId: arr[0].id |
|
|
|
}) |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
} else { |
|
|
|
util.showNone("当前用户无可用项目!") |
|
|
|
uni.clearStorageSync(); //清除 |
|
|
|
} |
|
|
|
} else { |
|
|
|
data.zkProperties = [{ |
|
|
|
id: "", |
|
|
|
propertyName: '' |
|
|
|
}] |
|
|
|
} |
|
|
|
let lopan = { |
|
|
|
id: data.zkProperties[0].id, |
|
|
|
name: data.zkProperties[0].propertyName |
|
|
|
util.showNone("当前用户无可用项目!") |
|
|
|
uni.clearStorageSync(); //清除 |
|
|
|
} |
|
|
|
uni.setStorageSync("fendianindex", 0); //写入缓存 |
|
|
|
uni.setStorageSync("weapp_session_userInfo_data", data); //写入缓存 |
|
|
|
uni.setStorageSync("buildingID", lopan); //项目id写入缓存 |
|
|
|
this.$u.post('/user/addLoginCount', { houseId: data.zkProperties[0].id}) |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getMenu(){ |
|
|
|
getMenu() { |
|
|
|
this.$u.get("/user/getMenu").then(data => { |
|
|
|
uni.setStorageSync("weapp_session_Menu_data", data) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
@@ -224,7 +239,8 @@ |
|
|
|
width: 750rpx; |
|
|
|
height: 500rpx; |
|
|
|
position: relative; |
|
|
|
.head-immg{ |
|
|
|
|
|
|
|
.head-immg { |
|
|
|
width: 118rpx; |
|
|
|
height: 61rpx; |
|
|
|
position: absolute; |
|
|
|