소스 검색

网上家园登录页面校验优化,工作台粘性布局

wulanhaote
yujk 3 년 전
부모
커밋
755eb98da1
2개의 변경된 파일19개의 추가작업 그리고 12개의 파일을 삭제
  1. +11
    -1
      src/views/onlineHome/workbench.vue
  2. +8
    -11
      src/views/onlineHomeLogin.vue

+ 11
- 1
src/views/onlineHome/workbench.vue 파일 보기

@@ -1,16 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<van-sticky>
<van-nav-bar <van-nav-bar
title="网上家园" title="网上家园"
> >
<template #left> <template #left>
<van-icon name="location" color="3A80FB" size="16"/> <van-icon name="location" color="3A80FB" size="16"/>
<p style="color: #878787;margin-left: 5px">柳沟村</p>
<p style="color: #878787;margin-left: 5px">{{deptName}}</p>
</template> </template>
<template #right> <template #right>
<van-icon name="wap-nav" color="#000" size="18"/> <van-icon name="wap-nav" color="#000" size="18"/>
</template> </template>
</van-nav-bar> </van-nav-bar>
</van-sticky>
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" style="width: 96%;margin: 2%;height:120px;border-radius: 6px;"> <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" style="width: 96%;margin: 2%;height:120px;border-radius: 6px;">
<van-swipe-item v-for="(image,index) in images" :key="index"> <van-swipe-item v-for="(image,index) in images" :key="index">
<img :src="image" style="width:100%;height: 120px"/> <img :src="image" style="width:100%;height: 120px"/>
@@ -356,6 +358,7 @@


<script> <script>
import onlineHomeIndex from "../onlineHomeIndex"; import onlineHomeIndex from "../onlineHomeIndex";
import {getInfo} from "../../api/login";
export default { export default {
components: { components: {
onlineHomeIndex onlineHomeIndex
@@ -365,8 +368,15 @@
return { return {
list1: [], list1: [],
images:['../../../static/images/onlineHome/tab.jpg'], images:['../../../static/images/onlineHome/tab.jpg'],
deptName:"",
}; };
}, },
created() {
getInfo().then(response => {
this.deptName = response.user.dept.deptName
});
},

} }
</script> </script>




+ 8
- 11
src/views/onlineHomeLogin.vue 파일 보기

@@ -9,17 +9,15 @@
<van-form style="margin:50px 0;" v-if="!showMessage"> <van-form style="margin:50px 0;" v-if="!showMessage">
<van-field <van-field
v-model="formData.username" v-model="formData.username"
name="请输入手机号"
placeholder="请输入手机号"
:rules="[{ required: true, message: '请填写手机号' }]"
placeholder="请输入手机号/账号"
:rules="[{ required: true, message:'' }]"
/> />
<van-field <van-field
v-model="formData.password" v-model="formData.password"
type="password" type="password"
name="请输入密码"
style="margin-top: 20px" style="margin-top: 20px"
placeholder="请输入密码" placeholder="请输入密码"
:rules="[{ required: true, message: '请填写密码' }]"
:rules="[{ required: true, message:'' }]"
/> />
<van-field <van-field
v-model="formData.code" v-model="formData.code"
@@ -43,7 +41,7 @@
v-model="formData.mobile" v-model="formData.mobile"
name="请输入手机号" name="请输入手机号"
placeholder="请输入手机号" placeholder="请输入手机号"
:rules="[{ required: true, message: '请填写用户名' }]"
:rules="[{ required: true, message: '' }]"
/> />
<van-field <van-field
v-model="formData.code" v-model="formData.code"
@@ -97,7 +95,6 @@
</van-field> </van-field>
<van-field <van-field
v-model="formData.smsCode" v-model="formData.smsCode"
name="请输入验证码"
style="margin-top: 20px" style="margin-top: 20px"
placeholder="请输入验证码" placeholder="请输入验证码"
:rules="[{ required: true, message: '请填写验证码' }]" :rules="[{ required: true, message: '请填写验证码' }]"
@@ -108,7 +105,7 @@
computeTime > 0 ? `(${computeTime}s)已发送` : "获取短信码" computeTime > 0 ? `(${computeTime}s)已发送` : "获取短信码"
}}</div> }}</div>


</template> </template>
</van-field> </van-field>
<div style="margin: 50px 16px 16px;"> <div style="margin: 50px 16px 16px;">
@@ -190,7 +187,7 @@
.registerSmsBtn{ .registerSmsBtn{
color: rgb(29, 111, 233); color: rgb(29, 111, 233);
font-size: 0.34rem; font-size: 0.34rem;
} }
</style> </style>
<script> <script>
@@ -374,7 +371,7 @@ export default {
} }
}, },
registerSubmit(){ registerSubmit(){
//注册 //注册
if (this.formData.memberName == "") { if (this.formData.memberName == "") {
this.$dialog.alert({ this.$dialog.alert({
@@ -403,7 +400,7 @@ export default {
if(res.code == 200){ if(res.code == 200){
registerOn(this.formData).then((res)=>{ registerOn(this.formData).then((res)=>{
if(res.code == 200){ if(res.code == 200){
//
//
this.$dialog.alert({ this.$dialog.alert({
message: '您的初始密码:'+res.password, message: '您的初始密码:'+res.password,
}).then(() => { }).then(() => {


불러오는 중...
취소
저장