Selaa lähdekoodia

宅基地app

wulanhaote
yujk 3 vuotta sitten
vanhempi
commit
62b44402e1
8 muutettua tiedostoa jossa 395 lisäystä ja 6 poistoa
  1. BIN
      src/assets/fonts/YOUSHEBIAOTIHEI.TTF
  2. +8
    -3
      src/permission.js
  3. +9
    -0
      src/router/index.js
  4. +3
    -2
      src/utils/request.js
  5. +1
    -1
      src/views/onlineHome/workbench.vue
  6. +374
    -0
      src/views/zjdLogin.vue
  7. BIN
      static/images/onlineHome/home_img.png
  8. BIN
      static/images/onlineHome/zjdLogo.png

BIN
src/assets/fonts/YOUSHEBIAOTIHEI.TTF Näytä tiedosto


+ 8
- 3
src/permission.js Näytä tiedosto

@@ -101,8 +101,11 @@ const whiteList = [
'/sunVillage/user/index', //个人中心
'/sunVillage/user/mobile', //个人中心-修改手机号
'/sunVillage/user/information', //个人中心-修改用户信息
'/sunVillage/user/cooperative' //个人中心-修改所属合作社
'/sunVillage/user/cooperative', //个人中心-修改所属合作社
//阳光村务公众号 -- 待删

//宅基地
'/zjdLogin',
]

router.beforeEach((to, from, next) => {
@@ -141,7 +144,8 @@ router.beforeEach((to, from, next) => {
} else if ('/homestead/index'.indexOf(to.path) !== -1) {
next({ path: '/homestead/login' })
} else if (to.path.indexOf('/onlineHome') !== -1) {
next(`/onlineHomeLogin`)
//next(`/onlineHomeLogin`)
next(`/zjdLogin`)
} else if (to.path.indexOf('/yinnong') !== -1) {
next(`/yinnongLogin`)
} else if (to.path.indexOf('/homesteadSurvey') !== -1) {
@@ -153,7 +157,8 @@ router.beforeEach((to, from, next) => {
}else if (to.path.indexOf('/homestead/') !== -1) {
next(`/homestead/login`)
} else {
next({ path: '/' })
next(`/zjdLogin`)
//next({ path: '/' })
}
})
})


+ 9
- 0
src/router/index.js Näytä tiedosto

@@ -2752,6 +2752,15 @@ export const constantRoutes = [
},
component: (resolve) => require(['@/views/sunVillage/user/cooperative'], resolve)
},
{
path: '/zjdLogin',
name: 'zjdLogin',
meta: {
title: '登录页',
hidden: true,
},
component: (resolve) => require(['@/views/zjdLogin'], resolve)
},
{
path: '/onlineHome/arbitrationList',
name: 'arbitrationList',


+ 3
- 2
src/utils/request.js Näytä tiedosto

@@ -85,7 +85,8 @@ service.interceptors.response.use(res => {
} else if (window.location.href.indexOf('homesteadSurvey') != -1) {
window.location.href = '/homesteadLogin';
} else if (window.location.href.indexOf('onlineHome') != -1) {
window.location.href = '/onlineHomeLogin';
//window.location.href = '/onlineHomeLogin';
window.location.href = '/zjdLogin';
} else if (window.location.href.indexOf('yinnong') != -1) {
window.location.href = '/yinnongLogin';
} else if (window.location.href.indexOf('/sunVillage') != -1) {
@@ -94,7 +95,7 @@ service.interceptors.response.use(res => {
window.location.href = '/homestead/login';
} else {
// 农村宅基地调查
window.location.href = '/homestead/login';
window.location.href = '/zjdLogin';

/*window.location.href = '/index';*/
}


+ 1
- 1
src/views/onlineHome/workbench.vue Näytä tiedosto

@@ -575,7 +575,7 @@
data() {
return {
list1: [],
images:['../../../static/images/onlineHome/tab.jpg'],
images:['../../../static/images/onlineHome/home_img.png'],
deptName:"",
queryParams: {
pageNum: 1,


+ 374
- 0
src/views/zjdLogin.vue Näytä tiedosto

@@ -0,0 +1,374 @@
<template>
<div class="app-container">
<div >
<img style="display: inline-block;width:100%;height:100%" src="../../static/images/onlineHome/zjdLogo.png" alt="">
<p class="logoFont">宅基地管理</p>
</div>
<div style="margin-top:0.5rem;padding:0 10px;">
<van-form style="margin:50px 0;" >
<van-field
v-model="formData.username"
placeholder="请输入手机号/账号"
:rules="[{ required: true, message:'' }]"
/>
<van-field
v-model="formData.password"
type="password"
style="margin-top: 20px"
placeholder="请输入密码"
:rules="[{ required: true, message:'' }]"
/>
<van-field
v-model="formData.code"
center
clearable
label="验证码"
:rules="[{ required: true, }]"
placeholder="图形验证码"
>
<template #button>
<img style="width: 100px" :src="codeUrl" @click="getCode" />
</template>
</van-field>
<van-checkbox style="float: left;margin-top:10px;margin-left:20px;" v-model="formData.rememberMe" shape="square">{{showMessage ? "记住手机号" : "记住密码"}}</van-checkbox>
<p style="float: right;margin-top:10px;margin-right:20px;color:#1D6FE9 ">忘记密码</p>
<div class="clear"></div>
<div style="margin: 50px 16px 16px;">
<van-button block type="info" native-type="submit" @click="handleLogin">登录</van-button>
</div>
</van-form>
</div>
<van-popup v-model="showKeyboard" :style="{ height: '100%',width:'100%' }" >
<van-nav-bar
left-arrow
fixed
placeholder
@click-left="showPopup"
/>
<div style="padding: 20px">
<h1>输入短信验证码</h1>
<h3 style="color: #878787">验证码已发送至{{(formData.mobile+"").substr(0,3) + "****" + (formData.mobile+"").substr(7)}},请在下方输入框内输入4位数字验证码</h3>
</div>
<van-password-input
:value="smsCodeValue"
:length="4"
:focused="showKeyboard"
@focus="showKeyboard = true"
/>
<van-number-keyboard
v-model="smsCodeValue"
:show="showKeyboard"
theme="custom"
close-button-text="完成"
/>
</van-popup>
</div>
</template>
<style scoped lang="scss">
@font-face {
font-family: YOUSHEBIAOTIHEI;
src: url("../assets/fonts/YOUSHEBIAOTIHEI.TTF");
}
.logoFont{
font-family:YOUSHEBIAOTIHEI;
text-align:center;
font-size:10vw;
line-height:30vw;
}
.app-container{
background: #fff;
height: 100vh;
}
.title{
padding-top: 20%;
width: 88%;
margin: 0 auto;
}
.van-tab--active{
font-size: .6rem;
font-weight: bold;
}
.van-tabs__line{
background:#1D6FE9;
width: 0.15rem;
height: 0.15rem;
border-radius: 0.07rem;
bottom: 0.3rem;
}
.van-tabs__nav{
padding:0
}
.van-tab{
display: inline-block;
flex: inherit;
margin-left: 30px;
line-height: .8rem;
}
.van-tab__text--ellipsis {
overflow: auto;
}
.van-password-input{
width: 50%;
margin: 0 auto;
}
[class*=van-hairline]::after{
border:none;
}
.van-password-input__security li{
margin: 0 10px;
border-bottom: 3px solid black;
}
.registerSmsBtn{
color: rgb(29, 111, 233);
font-size: 0.34rem;

}
</style>
<script>
import { getCodeImg, getSmsCode ,getRegisterSmsCode,registerCheck,registerOn} from "../api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "../utils/jsencrypt";
//引用wx sdk
import wx from "weixin-js-sdk";
export default {
name: "login",
data() {
return {
showMessage:false,
smsCodeValue:"",
showKeyboard:false,
formData: {
username: "", //账号
password: "", //密码
code: null, //图片验证码
uuid: null, //识别uuid
mobile: null, //手机号
smsCode: null, //短信验证码
memberName:null, //身份信息
idcard:null, //身份号码
rememberMe:false
},
loading: false,
codeUrl: "", //验证码
isSmsLogin: false, //是否手机验证码
computeTime: 0,
active:1
};
},
created() {
this.getCode();
this.getCookie();
this.reset();
},
methods: {
reset(){

},
showPopup(){
this.showKeyboard = !this.showKeyboard
},
showMessagePop(){
this.showMessage = !this.showMessage
},
getCode() {
getCodeImg().then((res) => {
this.formData.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img;
});
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
this.formData = {
username: username === undefined ? this.formData.username : username,
password:
password === undefined ? this.formData.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
getSmsCode() {
if (this.formData.code == "") {
this.$dialog.alert({
message: '图片验证码不能为空',
});
return false;
}
if (!this.computeTime) {
let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!myreg.test(this.formData.mobile)) {
this.$dialog.alert({
message: '手机号格式不正确',
});
return false;
}
/* getSmsCode(this.formData.mobile).then((res) => {
if (res.code === 200) {
this.$dialog.alert({
message: '验证码已发送',
});
this.showKeyboard = !this.showKeyboard;
this.loginForm.uuid = res.uuid;
this.computeTime = 60;
this.timer = setInterval(() => {
this.computeTime--;
if (this.computeTime <= 0) {
clearInterval(this.timer);
}
}, 1000);
}
});*/
}
},
handleLogin(values) {
if (this.isSmsLogin) {
//短信登录
let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!myreg.test(this.formData.mobile)) {
this.$dialog.alert({
message: '手机号格式不正确',
});
return false;
} else if (this.formData.smsCode == "") {
this.$dialog.alert({
message: '短信验证码不能为空',
});
return false;
}
this.loading = true;
this.$store
.dispatch("SmsLogin", this.formData)
.then(() => {
this.$router.push({ path: "/onlineHomeIndex" }).catch(() => {});
})
.catch((error) => {
this.loading = false;
});
} else {
if (this.formData.rememberMe) {
Cookies.set("username", this.formData.username, { expires: 30 });
Cookies.set("password", encrypt(this.formData.password), { expires: 30 });
Cookies.set("rememberMe", this.formData.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
//账号密码登录
if (this.formData.username == "") {
this.$dialog.alert({
message: '账号不能为空',
});
return false;
} else if (this.formData.password == "") {
this.$dialog.alert({
message: '密码不能为空',
});
return false;
} else if (!this.formData.code) {
this.$dialog.alert({
message: '图片验证码不能为空',
});
return false;
}
this.$store
.dispatch("Login", this.formData)
.then((resp) => {
this.$router.push({ path: "/onlineHome/workbench" }).catch(() => {});
})
.catch((error) => {
console.log(error)
this.loading = false;
this.getCode();
});
}
},
getRegisterSmsCode(){
if (!this.computeTime) {
let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!myreg.test(this.formData.mobile)) {
this.$dialog.alert({
message: '手机号格式不正确',
});
return false;
}else if (this.formData.code == "") {
this.$dialog.alert({
message: '图片验证码不能为空',
});
return false;
}
if (this.active==2) {
let formObj = {
code :this.formData.code,
mobile:this.formData.mobile,
uuid:this.formData.uuid
}
getRegisterSmsCode(formObj).then((res) => {
console.log(res)
console.log(res.code == 200)
if(res.code == 200) {
this.$dialog.alert({
message: '验证码已发送',
});
this.formData.uuid = res.uuid;
this.computeTime = 60;
this.timer = setInterval(() => {
this.computeTime--;
if (this.computeTime <= 0) {
clearInterval(this.timer);
}
}, 1000);
}
}).catch((res)=>{
if(res=='Error: 验证码已失效'){
this.getCode()
}
});
}
}
},
registerSubmit(){

//注册
if (this.formData.memberName == "") {
this.$dialog.alert({
message: '姓名不能为空',
});
return false;
} else if (this.formData.idcard == "") {
this.$dialog.alert({
message: '身份证号不能为空',
});
return false;
} else if (this.formData.mobile == "") {
this.$dialog.alert({
message: '手机号码不能为空',
});
return false;
}else if (this.formData.smsCode == "") {
this.$dialog.alert({
message: '短信验证码不能为空',
});
return false;
}
//registerCheck,registerOn
console.log(this.formData)
registerCheck(this.formData).then((res)=>{
if(res.code == 200){
registerOn(this.formData).then((res)=>{
if(res.code == 200){
//
this.$dialog.alert({
message: '您的初始密码:'+res.password,
}).then(() => {
this.$router.push({ path: "/onlineHome/workbench" }).catch(() => {});
});
}
})
}
})

}
},
};
</script>

BIN
static/images/onlineHome/home_img.png Näytä tiedosto

Before After
Leveys: 718  |  Korkeus: 256  |  Koko: 86 KiB

BIN
static/images/onlineHome/zjdLogo.png Näytä tiedosto

Before After
Leveys: 1043  |  Korkeus: 614  |  Koko: 194 KiB

Ladataan…
Peruuta
Tallenna