|
|
@ -12,15 +12,40 @@
|
|
|
|
<!-- <a-col :span="1" class="box-cen"></a-col> -->
|
|
|
|
<!-- <a-col :span="1" class="box-cen"></a-col> -->
|
|
|
|
<!-- 登录 -->
|
|
|
|
<!-- 登录 -->
|
|
|
|
<a-col class="box-b" v-if="status === 1">
|
|
|
|
<a-col class="box-b" v-if="status === 1">
|
|
|
|
<a-tabs v-model="activeName" @change="tabsSwitch">
|
|
|
|
<a-tabs v-model="activeName">
|
|
|
|
<!-- <a-tab-pane key="1" tab="密码登录"></a-tab-pane> -->
|
|
|
|
<a-tab-pane key="1" tab="密码登录"></a-tab-pane>
|
|
|
|
<a-tab-pane key="2" tab="验证码登录"> </a-tab-pane>
|
|
|
|
<a-tab-pane key="2" tab="验证码登录"> </a-tab-pane>
|
|
|
|
</a-tabs>
|
|
|
|
</a-tabs>
|
|
|
|
<div class="login-input" v-if="activeName === '1'">
|
|
|
|
<div class="login-input" v-if="activeName === '1'">
|
|
|
|
<div style="margin-top:18px"></div>
|
|
|
|
<a-cascader
|
|
|
|
|
|
|
|
:options="cityList"
|
|
|
|
|
|
|
|
placeholder="请选择城市"
|
|
|
|
|
|
|
|
v-model="cityvalue"
|
|
|
|
|
|
|
|
:show-search="{ filter }"
|
|
|
|
|
|
|
|
@change="onChange"
|
|
|
|
|
|
|
|
:field-names="{
|
|
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
|
|
value: 'id',
|
|
|
|
|
|
|
|
children: 'cityList',
|
|
|
|
|
|
|
|
}"
|
|
|
|
|
|
|
|
/>
|
|
|
|
<span class="form">
|
|
|
|
<span class="form">
|
|
|
|
<a-input placeholder="请输入手机号码"></a-input>
|
|
|
|
<a-select
|
|
|
|
<a-input type="password" placeholder="请输入密码"></a-input>
|
|
|
|
v-model="communityCode"
|
|
|
|
|
|
|
|
notFoundContent="该城市无可选择小区"
|
|
|
|
|
|
|
|
:disabled="cityvalue.length === 0"
|
|
|
|
|
|
|
|
placeholder="请选择小区"
|
|
|
|
|
|
|
|
@change="communityChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<a-select-option
|
|
|
|
|
|
|
|
v-for="(item) in communityList"
|
|
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
|
|
:value="item.code"
|
|
|
|
|
|
|
|
>{{ item.name }}</a-select-option
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</a-select>
|
|
|
|
|
|
|
|
<a-input v-model="pwdLogin.username" placeholder="请输入手机号码"></a-input>
|
|
|
|
|
|
|
|
<a-input v-model="pwdLogin.password" type="password" placeholder="请输入密码"></a-input>
|
|
|
|
<!-- <a-row>
|
|
|
|
<!-- <a-row>
|
|
|
|
<a-col :span="12" style="margin-left: 23px"
|
|
|
|
<a-col :span="12" style="margin-left: 23px"
|
|
|
|
><a-checkbox></a-checkbox> 三天之内免登陆</a-col
|
|
|
|
><a-checkbox></a-checkbox> 三天之内免登陆</a-col
|
|
|
@ -29,7 +54,7 @@
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<a-button
|
|
|
|
<a-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
@click="login"
|
|
|
|
@click="passwordLogin"
|
|
|
|
style="
|
|
|
|
style="
|
|
|
|
width: 90%;
|
|
|
|
width: 90%;
|
|
|
|
margin-left: 30px;
|
|
|
|
margin-left: 30px;
|
|
|
@ -42,7 +67,7 @@
|
|
|
|
</a-button>
|
|
|
|
</a-button>
|
|
|
|
<a-row style="margin-top: 20px; margin-left: 23px">
|
|
|
|
<a-row style="margin-top: 20px; margin-left: 23px">
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-checkbox></a-checkbox> 我已同意
|
|
|
|
<a-checkbox v-model="isChecked"></a-checkbox> 我已同意
|
|
|
|
<a href="/#/rule" target="tar">《用户协议》</a>
|
|
|
|
<a href="/#/rule" target="tar">《用户协议》</a>
|
|
|
|
<a href="/#/yszc" target="tar">《隐私政策》</a>
|
|
|
|
<a href="/#/yszc" target="tar">《隐私政策》</a>
|
|
|
|
</a-col>
|
|
|
|
</a-col>
|
|
|
@ -77,6 +102,7 @@
|
|
|
|
notFoundContent="该城市无可选择小区"
|
|
|
|
notFoundContent="该城市无可选择小区"
|
|
|
|
:disabled="cityvalue.length === 0"
|
|
|
|
:disabled="cityvalue.length === 0"
|
|
|
|
placeholder="请选择小区"
|
|
|
|
placeholder="请选择小区"
|
|
|
|
|
|
|
|
@change="communityChange"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<a-select-option
|
|
|
|
<a-select-option
|
|
|
|
v-for="item in communityList"
|
|
|
|
v-for="item in communityList"
|
|
|
@ -239,7 +265,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { loginTel, sendTelCode, userInfo } from "../../api/public/login";
|
|
|
|
import { loginTel, loginPWD, sendTelCode, userInfo } from "../../api/public/login";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "Login",
|
|
|
|
name: "Login",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
@ -250,7 +276,12 @@ export default {
|
|
|
|
tel: "",
|
|
|
|
tel: "",
|
|
|
|
code: "",
|
|
|
|
code: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
pwdLogin: {
|
|
|
|
|
|
|
|
username: '',
|
|
|
|
|
|
|
|
password: '',
|
|
|
|
|
|
|
|
},
|
|
|
|
isChecked: false,
|
|
|
|
isChecked: false,
|
|
|
|
|
|
|
|
communityId: undefined,
|
|
|
|
communityCode: undefined,
|
|
|
|
communityCode: undefined,
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
tel: [
|
|
|
|
tel: [
|
|
|
@ -288,6 +319,14 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
|
|
|
|
if(this.$route.query.token && this.$route.query.code) {
|
|
|
|
|
|
|
|
this.setToken(this.$route.query.token);
|
|
|
|
|
|
|
|
this.setCommunityCode(this.$route.query.code);
|
|
|
|
|
|
|
|
userInfo().then(result => {
|
|
|
|
|
|
|
|
this.setUserInfo(result.data);
|
|
|
|
|
|
|
|
this.$router.push("/");
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
this.keyupEnter();
|
|
|
|
this.keyupEnter();
|
|
|
|
this.getAllCity();
|
|
|
|
this.getAllCity();
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -371,6 +410,30 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
passwordLogin() {
|
|
|
|
|
|
|
|
if (this.communityCode === undefined) {
|
|
|
|
|
|
|
|
this.$message.error("先选择小区");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
if (this.isChecked == false) {
|
|
|
|
|
|
|
|
this.$message.error("请阅读并同意《用户协议》");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
let obj = Object.assign(this.pwdLogin, {communityId: this.communityId})
|
|
|
|
|
|
|
|
loginPWD(obj).then((res) => {
|
|
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
|
|
|
// 存储token
|
|
|
|
|
|
|
|
this.setToken(res.data);
|
|
|
|
|
|
|
|
userInfo().then(result => {
|
|
|
|
|
|
|
|
this.setUserInfo(result.data);
|
|
|
|
|
|
|
|
this.$router.push("/");
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
// 获取验证码
|
|
|
|
// 获取验证码
|
|
|
|
getCode() {
|
|
|
|
getCode() {
|
|
|
|
if (this.communityCode === undefined) {
|
|
|
|
if (this.communityCode === undefined) {
|
|
|
@ -408,9 +471,10 @@ export default {
|
|
|
|
resetForm() {
|
|
|
|
resetForm() {
|
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tabsSwitch() {
|
|
|
|
//改变小区获取id
|
|
|
|
console.log(this.activeName);
|
|
|
|
communityChange(value, option) {
|
|
|
|
},
|
|
|
|
this.communityId = option.key
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|