|
@@ -14,7 +14,7 @@
|
|
|
<view class="left-icon">
|
|
|
<image src="../../static/login_icon_phone@2x.png" style="width: 100%;height: 100%;"></image>
|
|
|
</view>
|
|
|
- <input class="uni-input item-input" v-model="form.phone" type="number" placeholder="请输入手机号" @input="changePhone" />
|
|
|
+ <input class="uni-input item-input" v-model="form.phone" type="number" placeholder="请输入手机号" @input="changePhone" />
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<view class="left-icon">
|
|
@@ -41,7 +41,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- isLoading:false,
|
|
|
+ isLoading: false,
|
|
|
phoneLength: 0, //手机号的长度
|
|
|
isShow: false, //判断是否显示重新获取
|
|
|
isGet: true, //判断是否显示获取验证码
|
|
@@ -60,23 +60,32 @@
|
|
|
},
|
|
|
created() {
|
|
|
let id = uni.getStorageSync('userId')
|
|
|
- let name =uni.getStorageSync('createBy')
|
|
|
+ let name = uni.getStorageSync('createBy')
|
|
|
// 判断当前用户是否已经登录过是 直接跳到首页 否 需要登录
|
|
|
- if(id && name){
|
|
|
+ if (id && name) {
|
|
|
uni.switchTab({
|
|
|
- url:'../index/index'
|
|
|
+ url: '../index/index'
|
|
|
})
|
|
|
- }else{
|
|
|
- if(id){
|
|
|
- uni.navigateTo({
|
|
|
- url:'./authorization'
|
|
|
- })
|
|
|
- }else{
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
+ // else{
|
|
|
+ // if(id){
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:'./authorization'
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 校验是否注册
|
|
|
+ check() {
|
|
|
+ this.http.httpRequest('/wxapplet/ownersid/checkphone', 'get', {
|
|
|
+ phoneNumBer: this.fom.phone
|
|
|
+ }, true).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 监听输入手机号码的长度
|
|
|
changePhone() {
|
|
|
this.phoneLength = this.form.phone.length
|
|
@@ -94,28 +103,41 @@
|
|
|
} else {
|
|
|
let phoneReg = /^1[3|4|5|7|8][0-9]{9}$/; //手机号正则校验
|
|
|
if (phoneReg.test(this.form.phone)) {
|
|
|
- this.isShow = true
|
|
|
- this.isGet = false
|
|
|
- const TIME_COUNT = 60;
|
|
|
- // 判断当前timer是否有值
|
|
|
- if (!this.timer) {
|
|
|
- this.num = TIME_COUNT;
|
|
|
- this.show = false;
|
|
|
- this.timer = setInterval(() => {
|
|
|
- // 判断当前num值大于0并且小于等于60执行
|
|
|
- if (this.num > 0 && this.num <= TIME_COUNT) {
|
|
|
- this.num--;
|
|
|
- } else {
|
|
|
- //否则就清除定时
|
|
|
- clearInterval(this.timer);
|
|
|
- this.timer = null;
|
|
|
- this.num = 0
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
- this.http.httpRequest('/wxapplet/ownersid/shortmessaging', 'get', {
|
|
|
+ this.http.httpRequest('/wxapplet/ownersid/checkphone', 'get', {
|
|
|
phoneNumBer: this.form.phone
|
|
|
- }, true).then((res) => {})
|
|
|
+ }, true).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ // 判断当前手机号是否注册
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.isShow = true
|
|
|
+ this.isGet = false
|
|
|
+ const TIME_COUNT = 60;
|
|
|
+ // 判断当前timer是否有值
|
|
|
+ if (!this.timer) {
|
|
|
+ this.num = TIME_COUNT;
|
|
|
+ this.show = false;
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ // 判断当前num值大于0并且小于等于60执行
|
|
|
+ if (this.num > 0 && this.num <= TIME_COUNT) {
|
|
|
+ this.num--;
|
|
|
+ } else {
|
|
|
+ //否则就清除定时
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.timer = null;
|
|
|
+ this.num = 0
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ this.http.httpRequest('/wxapplet/ownersid/shortmessaging', 'get', {
|
|
|
+ phoneNumBer: this.form.phone
|
|
|
+ }, true).then((res) => {})
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data,
|
|
|
+ 'icon': 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
"icon": "none",
|
|
@@ -140,8 +162,8 @@
|
|
|
return
|
|
|
} else {
|
|
|
uni.showLoading({
|
|
|
- mask:true,
|
|
|
- title:'登录中'
|
|
|
+ mask: true,
|
|
|
+ title: '登录中'
|
|
|
})
|
|
|
this.http.httpRequest('/wxapplet/ownersid/login', 'post', {
|
|
|
phoneNumBer: this.form.phone,
|
|
@@ -151,18 +173,18 @@
|
|
|
// 判断是否登陆成功
|
|
|
if (res.code == 0) {
|
|
|
console.log(res)
|
|
|
- uni.setStorageSync('userId',res.data[0].userId)
|
|
|
- uni.setStorageSync('idNumber',res.data[0].idcardNum)
|
|
|
- uni.setStorageSync('phoneNumber',res.data[0].phoneNumBer)
|
|
|
+ uni.setStorageSync('userId', res.data[0].userId)
|
|
|
+ uni.setStorageSync('idNumber', res.data[0].idcardNum)
|
|
|
+ uni.setStorageSync('phoneNumber', res.data[0].phoneNumBer)
|
|
|
// 判断当前是否已经认证过房屋了
|
|
|
- if(res.data[0].comtyInfos.length>0){
|
|
|
- uni.setStorageSync('comtyId',res.data[0].comtyInfos[0].cbId)
|
|
|
- uni.setStorageSync('homeId',res.data[0].comtyInfos[0].ownerBases[0].bid)
|
|
|
- uni.setStorageSync('homeAdress',res.data[0].comtyInfos[0].comtyName)
|
|
|
+ if (res.data[0].comtyInfos.length > 0) {
|
|
|
+ uni.setStorageSync('comtyId', res.data[0].comtyInfos[0].cbId)
|
|
|
+ uni.setStorageSync('homeId', res.data[0].comtyInfos[0].ownerBases[0].bid)
|
|
|
+ uni.setStorageSync('homeAdress', res.data[0].comtyInfos[0].comtyName)
|
|
|
uni.switchTab({
|
|
|
- url:'../index/index'
|
|
|
+ url: '../index/index'
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('走这里')
|
|
|
uni.navigateTo({
|
|
|
url: '../authentication/city'
|
|
@@ -176,7 +198,7 @@
|
|
|
'icon': 'none'
|
|
|
})
|
|
|
}
|
|
|
- }).catch(()=>{
|
|
|
+ }).catch(() => {
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
|
|
@@ -190,15 +212,19 @@
|
|
|
.getCode {
|
|
|
color: rgba(163, 197, 237, 1);
|
|
|
}
|
|
|
+
|
|
|
.codeActive {
|
|
|
color: rgba(41, 138, 253, 1);
|
|
|
}
|
|
|
+
|
|
|
.cx {
|
|
|
color: rgba(163, 197, 237, 1);
|
|
|
}
|
|
|
+
|
|
|
.cxActive {
|
|
|
color: rgba(41, 138, 253, 1);
|
|
|
}
|
|
|
+
|
|
|
.regiter {
|
|
|
width: 56rpx;
|
|
|
height: 40rpx;
|