Explorar el Código

Task 事项

master
zhaodengke hace 7 meses
padre
commit
1dc9167724
Se han modificado 8 ficheros con 344 adiciones y 3 borrados
  1. +1
    -1
      config/index.js
  2. +8
    -0
      src/api/register/index.js
  3. +1
    -0
      src/assets/maps/plotPremises_huancui.json
  4. +1
    -0
      src/assets/maps/qu_huancui.json
  5. +3
    -0
      src/permission.js
  6. +9
    -0
      src/router/index.js
  7. +25
    -2
      src/views/sunVillage_info/identity_check.vue
  8. +296
    -0
      src/views/sunVillage_info/login_farmer.vue

+ 1
- 1
config/index.js Ver fichero

@@ -12,7 +12,7 @@ module.exports = {
proxyTable: { proxyTable: {
"/api": { "/api": {
// 请求的目标主机 // 请求的目标主机
// target: 'http://116.255.223.226:8082/nsgk_test/', // 公网测试环境
//target: 'http://218.59.175.44:8082/nsgk_test/', // 公网测试环境
// target: `http://192.168.0.116:8091/nsgk_api/`, // 内网测试环境 // target: `http://192.168.0.116:8091/nsgk_api/`, // 内网测试环境
target: 'http://localhost:8080/', target: 'http://localhost:8080/',
//target: 'http://192.168.0.106:8080/', //target: 'http://192.168.0.106:8080/',


+ 8
- 0
src/api/register/index.js Ver fichero

@@ -70,3 +70,11 @@ export function depositList(query) {
}) })
} }


export function farmerLogin(data) {
return request({
url: '/register/farmerLogin',
method: 'post',
data: data,
})
}


+ 1
- 0
src/assets/maps/plotPremises_huancui.json Ver fichero

@@ -0,0 +1 @@
[]

+ 1
- 0
src/assets/maps/qu_huancui.json Ver fichero

@@ -0,0 +1 @@
[]

+ 3
- 0
src/permission.js Ver fichero

@@ -187,6 +187,9 @@ const whiteList = [
'/plotPremisesMobile/index',//闲置资源 '/plotPremisesMobile/index',//闲置资源




'/sunVillage_info/login_farmer', //详情页


//承包地确权 //承包地确权
'/contracted/login',//登录 '/contracted/login',//登录
'/contracted/index',//首页 '/contracted/index',//首页


+ 9
- 0
src/router/index.js Ver fichero

@@ -5927,6 +5927,15 @@ export const constantRoutes = [
}, },
component: (resolve) => require(['@/views/contracted/user/passWord'], resolve) component: (resolve) => require(['@/views/contracted/user/passWord'], resolve)
}, },
{ ////阳光村务(一村一码)-- 村民登录
path: '/sunVillage_info/login_farmer',
name: 'sunVillageInfoFarmerLogin',
meta: {
title: '村民验证登录',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/login_farmer'], resolve)
},
]; ];






+ 25
- 2
src/views/sunVillage_info/identity_check.vue Ver fichero

@@ -42,16 +42,20 @@
responseData: null, responseData: null,
remainingSeconds: 3, // 剩余秒数,初始值为3秒 remainingSeconds: 3, // 剩余秒数,初始值为3秒
formData:null, formData:null,
redirectPath: '/sunVillage_info/index_code_rights',
redirectName: null,
redirectQuery: null,
}; };
}, },
created() { created() {
this.loadRedirectInfo();
this.responseData = this.$route.query.responseData; this.responseData = this.$route.query.responseData;
// 判断是否已认证 // 判断是否已认证
if (this.responseData.isFacial === 'Y') { if (this.responseData.isFacial === 'Y') {
const countdownInterval = setInterval(() => { const countdownInterval = setInterval(() => {
if (this.remainingSeconds === 0) { if (this.remainingSeconds === 0) {
clearInterval(countdownInterval); // 清除计时器 clearInterval(countdownInterval); // 清除计时器
this.$router.push({ path: '/sunVillage_info/index_code_rights' });
this.redirect();
} else { } else {
this.remainingSeconds--; this.remainingSeconds--;
} }
@@ -97,7 +101,7 @@
message: '人脸验证成功', message: '人脸验证成功',
duration: "1000" duration: "1000"
}); });
this.$router.push({path: '/sunVillage_info/index_code_rights'})
this.redirect();
} }
}) })
}, },
@@ -110,6 +114,25 @@
this.formData.append("file", file.file); this.formData.append("file", file.file);
this.$toast.clear(); this.$toast.clear();
}, },
loadRedirectInfo() {
if(this.$route.query.redirectPath)
this.redirectPath = this.$route.query.redirectPath;
if(this.$route.query.redirectName)
this.redirectName = this.$route.query.redirectName;
if(this.$route.query.redirectQuery)
this.redirectQuery = this.$route.query.redirectQuery;
console.log('redirect info: ', this.redirectPath, this.redirectName, this.redirectQuery);
},
redirect() {
let parms = {};
if(this.redirectPath)
parms.path = this.redirectPath;
else if(this.redirectName)
parms.name = this.redirectName;
if(this.redirectQuery)
parms.query = this.redirectQuery;
this.$router.push(parms);
},
}, },
}; };
</script> </script>


+ 296
- 0
src/views/sunVillage_info/login_farmer.vue Ver fichero

@@ -0,0 +1,296 @@
<template>
<div class="home_wrapper">
<div class="return_btn" @click="onClickLeft"></div>
<div class="focus_head">
</div>
<div class="focus_info">
<div class="icon"></div>
<div class="title"></div>
</div>
<van-form @submit="handleLogin">
<div class="login_from">
<div class="flex_block">
<div class="flex_input_main">
<div class="icon_wrap user"></div>
<div class="input_wrap">
<input type="text" v-model="formData.name" class="ipt" placeholder="姓名"/>
</div>
</div>
</div>
<div class="flex_block">
<div class="flex_input_main">
<div class="icon_wrap password"></div>
<div class="input_wrap">
<input type="text" v-model="formData.idcard" class="ipt" placeholder="身份证号码"/>
</div>
</div>
</div>
<van-checkbox v-model="formData.rememberMe">记住我的信息</van-checkbox>
</div>
<div class="login_btn">
<van-button
class="btn"
round
block
type="info"
native-type="submit"
color="linear-gradient(to right, #2ec8c4, #30c271)"
:loading="loading"
>验证</van-button>
</div>

</van-form>
</div>
</template>

<script>
import { getCodeImg, getSmsCode } from "@/api/login";
import { checkFarmer, allowFaceVerify } from "@/api/sunVillage_info/fixedAssets";
import { getFamilyMemberList } from "@/api/sunVillage_info/homestead/familyMember";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "../../utils/jsencrypt";
//引用wx sdk
import wx from "weixin-js-sdk";
import {farmerLogin} from "@/api/register";
export default {
name: "loginFarmer",
data() {
return {
formData: {
name: '',
idcard: '',
rememberMe: false,
},
loading: false,
codeUrl: "", //验证码
isSmsLogin: false, //是否手机验证码
computeTime: 0,
height:0,
show:true
};
},
created() {
this.height = document.body.clientHeight
this.getCookie();
},
methods: {
getCookie() {
const memberName = Cookies.get("memberName");
const idcard = Cookies.get("idcard");
const rememberMe = Cookies.get("rememberInformation");
if(memberName !== undefined)
this.formData.name = memberName;
if(idcard !== undefined)
this.formData.idcard = idcard;
if(rememberMe !== undefined)
this.formData.rememberMe = Boolean(rememberMe);
},
remember() {
if (this.formData.rememberMe) {
Cookies.set("memberName", this.formData.name, { expires: 30 });
Cookies.set("idcard", this.formData.idcard, { expires: 30 });
Cookies.set("rememberInformation", this.formData.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberInformation");
}
},
validate() {
if (this.formData.name == "") {
this.$dialog.alert({
message: '姓名不能为空',
});
return false;
} else if (this.formData.idcard == "") {
this.$dialog.alert({
message: '身份证不能为空',
});
return false;
}
return true;
},
handleLogin(values) {
this.remember();
if(!this.validate())
return;

farmerLogin(this.formData).then(response => {
const farmer = response.data;

let seconds = 3600;
let expires = new Date(new Date() * 1 + seconds * 1000);

Cookies.set("bookName", farmer.bookName, {
expires: 30,
});
Cookies.set("deptName", farmer.deptName, {
expires: 30,
});
Cookies.set("bookId", farmer.bookId, {
expires: 30,
});
Cookies.set("deptId", farmer.deptId, {
expires: 30,
});

const farmerCode = farmer.hzFarmerCode;
Cookies.set("farmerCode",farmerCode, { expires: 30 });
Cookies.set("user", farmer, { expires: expires });
allowFaceVerify().then(resp => {
if(resp.data === 'true' || 1)
{
this.$router.push({
path: '/sunVillage_info/identity_check',
query: {
responseData: response.data,
redirectPath: '/sunVillage_info/index_code',
}});
}
else
this.$router.push({path:'/sunVillage_info/index_code_rights'});
});
});
},
},
};
</script>

<style scoped lang="scss">
/deep/ .van-checkbox__label{
color: #ffffff;
}
/deep/ .van-checkbox{
justify-content: right;
}
.home_wrapper{
background: #f1f2f2;
width: 100vw;
min-height: 100vh;
.return_btn {
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
.focus_head{
height: 450px;
background: url('../../assets/images/sunVillage_info/login_head_code_green.png') no-repeat;
background-size: 100% 100%;

}
.focus_info{
margin-top: -74px;
.icon{
background: url('../../assets/images/sunVillage_info/login_head_t.png') no-repeat;
background-size: 100% 100%;
width: 145px;
height: 148px;
margin:0 auto;
}
.title{
width: 180PX;
height: 52px;
background: url('../../assets/images/sunVillage_info/login_head_nr_code.png') no-repeat;
background-size: 100% 100%;
margin:30px auto 0;
}
}
.login_from{
width: 676px;
height: 350px;
background: url('../../assets/images/sunVillage_info/login_main_green.png') no-repeat;
background-size: 100% 100%;
margin: 50px auto 0;
padding:60px 50px 0;
.flex_block{
margin-bottom: 40px;
display: flex;
justify-content:space-between;
.flex_input_main{
position: relative;
display: flex;
flex: 1;
align-items:center;
background: rgba(255,255,255,0.7);
border-radius: 62px;
height: 62px;
.icon_wrap{
width: 35px;
height: 35px;
&.user{
background: url('../../assets/images/sunVillage_info/login_icon_1.png') no-repeat;
background-size: 100% 100%;
margin-left: 30px;
}
&.password{
background: url('../../assets/images/sunVillage_info/login_icon_2_code.png') no-repeat;
height: 25px;
background-size: 100% 100%;
margin-left: 30px;
}
&.valid{
background: url('../../assets/images/sunVillage_info/login_icon_3.png') no-repeat;
background-size: 100% 100%;
margin-left: 30px;
}
}
.input_wrap{
flex: 1;
margin-left: 16px;
padding-right: 30px;
.ipt{
width: 100%;
height: 48px;
background:transparent;
font-size: 30px;
color: #3f3d56;
}
}
.showHidden{
width: 32px;
height: 32px;
background: url('../../assets/images/sunVillage_info/login_icon_4.png') no-repeat;
background-size: 100% 100%;
position: absolute;
right: 38px;
cursor: pointer;
&.ico_hide{
background: url('../../assets/images/sunVillage_info/login_icon_5.png') no-repeat;
background-size: 100% 100%;
}
}
&.valid{
flex:0 0 380px;
}
}
.valid_main{
width: 165px;
height: 62px;
border-radius: 30px;
img{
width: 100%;
height: 100%;
border-radius: 30px;
}
}
}
}
.login_btn{
padding-top: 80px;
.btn{
width: 315px;
height: 80px;
margin:0 auto;
font-size: 32px;
color: #fff;
text-align: center;
border: none;
}
}
}

</style>

Cargando…
Cancelar
Guardar