瀏覽代碼

找回密码

luyanan 6 年之前
父節點
當前提交
711cb546a4

+ 1 - 1
build/webpack.base.conf.js

@ -73,7 +73,7 @@ module.exports = {
73 73
        }
74 74
      },
75 75
      {
76
        test: /\.(woff|svg|woff2|eot|ttf|otf)(\?.*)?$/,
76
        test: /\.(woff2?|eot|ttf|otf|woff|svg)(\?.*)?$/,
77 77
        loader: 'url-loader',
78 78
        options: {
79 79
          limit: 10000,

+ 1 - 1
package.json

@ -58,7 +58,7 @@
58 58
    "rimraf": "^2.6.0",
59 59
    "semver": "^5.3.0",
60 60
    "shelljs": "^0.7.6",
61
    "stylus-loader": "^2.1.1",
61
    "stylus-loader": "^2.5.1",
62 62
    "uglifyjs-webpack-plugin": "^1.1.1",
63 63
    "url-loader": "^0.5.8",
64 64
    "vue-loader": "^13.3.0",

+ 0 - 35
src/common/stylus/common.styl

@ -58,41 +58,6 @@ a
58 58
    font-size:13px
59 59
    color:$secondaryFont
60 60
61
/*form-css*/
62
.frmtype
63
  width:100%
64
  box-sizing: border-box
65
  border:none
66
  border:1px #d2d2d2 solid
67
  height:46px
68
  background: #f5f6f8
69
  padding:4px 10px
70
  font-size:14px
71
  outline: none
72
  &.btnModel
73
    margin:20px 0 0
74
    color:#FFFFFF
75
    border:none
76
    cursor:pointer
77
    background:$mainColor
78
.fontLink
79
  background:none
80
  border:none
81
  color:$mainColor
82
  font-size:13px
83
.frmmsg
84
  position:relative
85
  padding-left:20px
86
  line-height:28px
87
  color: #fd5f39
88
  &:before
89
    content: ''
90
    position: absolute
91
    left: 0
92
.frmmsg-warning
93
  border: 1px solid #fd5f39
94
/*form-css*/
95
96 61
97 62
.el-button--primary
98 63
  background-color: $mainColor;

+ 2 - 1
src/common/stylus/index.styl

@ -1,3 +1,4 @@
1 1
@import './base'
2 2
@import './common'
3
@import "./mixin"
3
/*@import './icon'*/
4
@import './mixin'

+ 1 - 1
src/components/bench-views/WorkHead.vue

@ -34,7 +34,7 @@
34 34
    data() {
35 35
      return {
36 36
        animateStatus: false
37
      }
37
      };
38 38
    },
39 39
    methods: {
40 40
      overShow() {

+ 133 - 0
src/components/form-views/findPwd.vue

@ -0,0 +1,133 @@
1
<template>
2
  <div class="login">
3
    <div class="logo-wrapper"></div>
4
    <div class="form-wrapper">
5
      <div class="form-contain">
6
        <p class="form-title">找回密码</p>
7
        <div class="step-wrapper">
8
          <el-steps :active="stepVal" finish-status="success" align-center>
9
            <el-step title="输入邮箱"></el-step>
10
            <el-step title="接收密码找回邮件"></el-step>
11
            <el-step title="重置密码"></el-step>
12
          </el-steps>
13
        </div>
14
15
        <div class="step-contain">
16
          <el-form v-show="!isStepShow" :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
17
            <el-form-item prop="mail">
18
              <el-input v-model="ruleForm.mail" placeholder="请输入邮箱账号"></el-input>
19
            </el-form-item>
20
            <el-form-item></el-form-item>
21
            <el-form-item>
22
              <el-button type="primary" :disabled="isDisabl" @click="nextStep">下一步</el-button>
23
              <el-button type="text" @click="goLogin">又想起来了</el-button>
24
            </el-form-item>
25
          </el-form>
26
          <el-form v-show="isStepShow" class="demo-ruleForm">
27
            <el-form-item>
28
              <p class="importTip">密码找回邮件已发送至:<br />
29
                <span class="mainTip" id="emailShow">jdksgjksdgjsdhgs</span>
30
              </p>
31
              <p class="smallTip">请您在10分钟内登录您的企业邮箱,接收邮件,<br />点击链接后即可重置密码。</p>
32
            </el-form-item>
33
            <el-form-item></el-form-item>
34
            <el-form-item>
35
              <el-button type="primary" @click="goToMail">登录邮箱</el-button>
36
            </el-form-item>
37
          </el-form>
38
          <el-form v-show="!isStepShow" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
39
            <el-form-item prop="pass">
40
              <el-input type="password" v-model="ruleForm2.pass" placeholder="请设置您的新密码" auto-complete="off"></el-input>
41
            </el-form-item>
42
            <el-form-item prop="checkPass">
43
              <el-input type="password" v-model="ruleForm2.checkPass" placeholder="请再次输入密码确认" auto-complete="off"></el-input>
44
            </el-form-item>
45
            <el-form-item></el-form-item>
46
            <el-form-item>
47
              <el-button type="primary" :disabled="isDisabl" @click="resetPwd">重置密码</el-button>
48
            </el-form-item>
49
          </el-form>
50
        </div>
51
      </div>
52
    </div>
53
  </div>
54
</template>
55
56
<script type="text/ecmascript-6">
57
  export default {
58
     data() {
59
      var validatePass = (rule, value, callback) => {
60
        if (value === '') {
61
          callback(new Error('请设置您的新密码'));
62
        } else if (value.length < 6 || value.length > 24) {
63
         callback(new Error('密码由6-24个字符组成,区分大小写'));
64
        } else {
65
          if (this.ruleForm2.checkPass !== '') {
66
            this.$refs.ruleForm2.validateField('checkPass');
67
          }
68
          callback();
69
        }
70
      };
71
      var validatePass2 = (rule, value, callback) => {
72
        if (value === '') {
73
          callback(new Error('请再次输入密码确认'));
74
        } else if (value !== this.ruleForm2.pass) {
75
          callback(new Error('两次输入密码不一致,请重新输入!'));
76
        } else {
77
          callback();
78
        }
79
      };
80
      return {
81
        stepVal: 0,
82
        isStepShow: true,
83
        isDisabl: false,
84
        ruleForm: {
85
          mail: ''
86
        },
87
        rules: {
88
          mail: [
89
            { required: true, message: '请输入邮箱账号', trigger: 'blur' },
90
            { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
91
          ]
92
        },
93
        ruleForm2: {
94
          pass: '',
95
          checkPass: ''
96
        },
97
        rules2: {
98
          pass: [
99
            { validator: validatePass, trigger: 'blur' }
100
          ],
101
          checkPass: [
102
            { validator: validatePass2, trigger: 'blur' }
103
          ]
104
        }
105
      };
106
    },
107
    methods: {
108
      nextStep() {
109
        return this.stepVal++ > 2;
110
      },
111
      resetPwd(formName) {
112
        this.$refs[formName].validate((valid) => {
113
          if (valid) {
114
            alert('submit!');
115
            this.$router.push({path: '/WorkHome'});
116
          } else {
117
            return false;
118
          }
119
        });
120
      },
121
      goLogin() {
122
        this.$router.push({path: '/loginPlat'});
123
      },
124
      goToMail() {
125
        this.$router.push({path: '/loginPlat'});
126
      }
127
    }
128
  };
129
</script>
130
131
<style lang="stylus" rel="stylesheet/stylus">
132
  @import './style';
133
</style>

+ 46 - 21
src/components/form-views/loginPlat.vue

@ -2,34 +2,59 @@
2 2
  <div class="login">
3 3
    <div class="logo-wrapper"></div>
4 4
    <div class="form-wrapper">
5
      <form class="form-contain">
5
      <div class="form-contain">
6 6
        <p class="form-title">登录平台工作台</p>
7
        <ul class="form-ul">
8
          <li>
9
            <input type="email" class="frmtype" hidden autocomplete="off"/>
10
            <input type="email" class="frmtype companyEmail" placeholder="请输入邮箱账号" autocomplete="off"/>
11
            <div class="frmmsg">333</div>
12
          </li>
13
          <li>
14
            <input type="password" class="frmtype" placeholder="请输入登录密码"/>
15
            <div class="frmmsg msgLog2"><span></span></div>
16
          </li>
17
          <li>
18
            <button type="button" disabled class="frmtype btnModel" @click="login">登录</button>
19
            <router-link to="workBench">wwww</router-link>
20
            <router-link class="fontLink" to="">忘记密码?</router-link>
21
          </li>
22
        </ul>
23
      </form>
7
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
8
          <el-form-item prop="mail">
9
            <el-input v-model="ruleForm.mail" placeholder="请输入邮箱账号"></el-input>
10
          </el-form-item>
11
          <el-form-item prop="pass">
12
            <el-input type="password" v-model="ruleForm.pass" placeholder="请输入登录密码" auto-complete="off"></el-input>
13
          </el-form-item>
14
          <el-form-item></el-form-item>
15
          <el-form-item>
16
            <el-button type="primary" :disabled="isDisabl" @click="submitForm('ruleForm')">登录</el-button>
17
            <el-button type="text" @click="goBackPwd">忘记密码?</el-button>
18
          </el-form-item>
19
        </el-form>
20
      </div>
24 21
    </div>
25 22
  </div>
26 23
</template>
27 24

28
<script>
25
<script type="text/ecmascript-6">
29 26
  export default {
27
     data() {
28
      return {
29
        isDisabl: false,
30
        ruleForm: {
31
          mail: '',
32
          pass: ''
33
        },
34
        rules: {
35
          mail: [
36
            { required: true, message: '请输入邮箱账号', trigger: 'blur' },
37
            { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
38
          ],
39
          pass: [
40
            { required: true, message: '请输入登录密码', trigger: 'blur' },
41
            { min: 6, max: 24, message: '密码由6-24个字符组成,区分大小写', trigger: 'blur' }
42
          ]
43
        }
44
      };
45
    },
30 46
    methods: {
31
      login() {
32
          this.$router.push({path:'/WorkHome'});
47
      submitForm(formName) {
48
        this.$refs[formName].validate((valid) => {
49
          if (valid) {
50
            this.$router.push({path: '/WorkHome'});
51
          } else {
52
            return false;
53
          }
54
        });
55
      },
56
      goBackPwd() {
57
        this.$router.push({path: '/findPwd'});
33 58
      }
34 59
    }
35 60
  };

+ 17 - 5
src/components/form-views/style.styl

@ -34,8 +34,20 @@
34 34
        color:$mainColor
35 35
        text-align:center
36 36
        margin-bottom:40px
37
      .form-ul>li
38
        margin-bottom:12px
39
        .frmtype
40
          border-radius()
41
      
37
      .el-button--primary
38
        width:100%
39
40
  .step-wrapper
41
    margin-bottom:30px
42
  .step-contain
43
    text-align:center
44
    .importTip
45
      font-size: 18px
46
      margin: 10px 0
47
    .mainTip
48
      color:$mainColor
49
    .smallTip
50
      color:$secondaryFont
51
      line-height:16px
52
      font-size:13px
53

+ 1 - 4
src/components/main-views/ViewHome.vue

@ -16,7 +16,7 @@
16 16
          将您的需求发布到科袖网,<br>
17 17
          我们为您对接专家和各类专业机构。
18 18
        </p>
19
        <button type="button" class="frmtype btnModel">免费发布需求</button>
19
        <el-button type="primary" style="margin-top:30px">免费发布需求</el-button>
20 20
      </div>
21 21
    </div>
22 22
@ -254,9 +254,6 @@
254 254
          font-size: 14px
255 255
          line-height: 22px
256 256
          color:$secondaryFont
257
        .frmtype
258
          margin-top:28px
259
          width:60%
260 257
      .plat-news
261 258
        width:800px
262 259
        height:200px

+ 2 - 0
src/components/main-views/ViewPlatTrend.vue

@ -63,6 +63,8 @@ import baseArticle from '../sub-component/BaseArticle';
63 63
			cursor: pointer
64 64
			&.active
65 65
				color: $mainColor
66
		.el-tabs__header
67
			margin: 0 0 4px
66 68
		.el-tabs__nav-wrap::after
67 69
			content:none
68 70
		.el-tabs__content

+ 10 - 1
src/router/router.js

@ -5,10 +5,18 @@ export const loginRouter = {
5 5
    path: '/loginPlat',
6 6
    name: 'loginPlat',
7 7
    meta: {
8
        title: 'Login - 登录'
8
        title: 'Login-登录'
9 9
    },
10 10
    component: () => import('@/components/form-views/loginPlat.vue')
11 11
};
12
export const pwdRouter = {
13
    path: '/findPwd',
14
    name: 'findPwd',
15
    meta: {
16
        title: '找回密码'
17
    },
18
    component: () => import('@/components/form-views/findPwd.vue')
19
};
12 20

13 21
// 作为Main组件的子页面展示
14 22
export const otherRouter = {
@ -73,6 +81,7 @@ export const appRouter = {
73 81
// 所有上面定义的路由都要写在下面的routers里
74 82
export const routers = [
75 83
    loginRouter,
84
    pwdRouter,
76 85
    otherRouter,
77 86
    appRouter
78 87
];