浏览代码

个人中心

lipengtao 6 年之前
父节点
当前提交
850a6d3d59

+ 0 - 1
src/components/global-component/citypick/CityPick.vue

@ -34,7 +34,6 @@
34 34
35 35
<script type="text/ecmascript-6">
36 36
  import cityData from './city-data.js';
37
38 37
  export default {
39 38
    props: {
40 39
      prov: {

+ 68 - 1
src/router/index.js

@ -1,12 +1,15 @@
1 1
import Vue from 'vue';
2 2
import Router from 'vue-router';
3
import Layout from '@/views/layout/Layout';
3
import Layout from '@/views/layout/layout';
4
import Common from '@/views/layout/common';
4 5
5 6
Vue.use(Router);
6 7
7 8
const constantRouterMap = [
8 9
  { path: '/loginPlat', component: () => import('@/views/logforms/loginPlat') },
9 10
  { path: '/findPwd', component: () => import('@/views/logforms/findPwd') },
11
  { path: '/register', component: () => import('@/views/logforms/register') },
12
  { path: '/enterRegister', component: () => import('@/views/logforms/enteringRegister') },
10 13
  {
11 14
    path: '/',
12 15
    component: Layout,
@ -216,6 +219,70 @@ const constantRouterMap = [
216 219
      name: 'about',
217 220
      meta: { title: '关于平台' }
218 221
    }]
222
  },
223
  {
224
    path: '',
225
    name: 'personalCenter',
226
    meta: { title: '个人中心' },
227
    component: Common,
228
      children: [{
229
        path: '/modifyData',
230
        component: () => import('@/views/personalCenter/modifyData'),
231
        name: 'modifyData',
232
        meta: { title: '修改资料' }
233
      }, {
234
        path: '/modifyPassword',
235
        component: () => import('@/views/personalCenter/modifyPassword'),
236
        name: 'modifyPassword',
237
        meta: { title: '修改密码' }
238
      }, {
239
        path: '/attentionCollect',
240
        component: () => import('@/views/personalCenter/attentionCollect'),
241
        name: 'attentionCollect',
242
        meta: { title: '关注收藏' }
243
      }, {
244
        path: '/myNeeds',
245
        component: () => import('@/views/personalCenter/myNeeds/index'),
246
        name: 'myNeeds',
247
        meta: { title: '我的需求' },
248
        children: [{
249
          path: '/modifyDemand',
250
          component: () => import('@/views/personalCenter/myNeeds/modifyDemand'),
251
          name: 'modifyDemand',
252
          meta: { title: '修改需求' }
253
        }, {
254
          path: '/examineDemand',
255
          component: () => import('@/views/personalCenter/myNeeds/examineDemand'),
256
          name: 'examineDemand',
257
          meta: { title: '查看需求' }
258
        }, {
259
          path: '/myDemand',
260
          component: () => import('@/views/personalCenter/myNeeds/myNeed'),
261
          name: 'myDemand',
262
          meta: { title: '我的需求' }
263
        }]
264
      }, {
265
        path: '/myBusiness',
266
        component: () => import('@/views/personalCenter/myNeeds/index'),
267
        name: 'myBusiness',
268
        meta: { title: '我的企业' },
269
        children: [{
270
          path: '/companyInformation',
271
          component: () => import('@/views/personalCenter/myBusiness/companyInformation'),
272
          name: 'companyInformation',
273
          meta: { title: '企业信息' }
274
        }, {
275
          path: '/companyProduct',
276
          component: () => import('@/views/personalCenter/myBusiness/companyProduct'),
277
          name: 'companyProduct',
278
          meta: { title: '企业产品' }
279
        }, {
280
          path: '/publishProduct',
281
          component: () => import('@/views/personalCenter/myBusiness/publishProduct'),
282
          name: 'publishProduct',
283
          meta: { title: '发布产品' }
284
        }]
285
      }]
219 286
  }
220 287
];
221 288

+ 45 - 0
src/views/layout/common.vue

@ -0,0 +1,45 @@
1
<template>
2
  <div class="main Site">
3
    <TheHeader></TheHeader>
4
    <Navbar></Navbar>
5
    <div class="Site-content">
6
      <div class="contain-wrapper">
7
        <con></con>
8
      </div>
9
    </div>
10
    <TheFooter></TheFooter>
11
  </div>
12
</template>
13
14
<script>
15
  import { TheHeader, TheFooter, Navbar } from './components';
16
  import con from '../personalCenter/common/index';
17
18
  export default {
19
    name: 'layout',
20
    components: {
21
      TheHeader,
22
      TheFooter,
23
      con,
24
      Navbar
25
    }
26
  };
27
</script>
28
29
<style lang="stylus" rel="stylesheet/stylus" scoped>
30
31
  .Site
32
    display: flex
33
    min-height: 100vh
34
    flex-direction: column
35
    .Site-content
36
      flex: 1
37
      padding-top:20px
38
      .router-fade-enter-active,
39
      .router-fade-leave-active
40
        transition: opacity 0.2s
41
42
      .router-fade-enter,
43
      .router-fade-leave-active
44
        opacity: 0
45
</style>

+ 40 - 0
src/views/logforms/Captcha.vue

@ -0,0 +1,40 @@
1
<template>
2
<el-dialog title="请完成验证" :visible.sync="dialogFormVisible" width="460px">
3
  <el-form :model="form">
4
    <el-form-item>
5
      <el-input v-model="form.name" autocomplete="off" placeholder="请输入图片验证码" class="imageCode"></el-input>
6
      <img src="/ajax/PictureVC" class="frmtypeW">
7
    </el-form-item>
8
  </el-form>
9
  <div slot="footer" class="dialog-footer">
10
    <el-button @click="dialogFormVisible = false">取 消</el-button>
11
    <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
12
  </div>
13
</el-dialog>
14
</template>
15
<script>
16
  export default {
17
    data() {
18
      return {
19
        dialogFormVisible: false,
20
        form: {
21
          name: ''
22
        }
23
      };
24
    },
25
    methods: {
26
        capShow() {
27
            this.dialogFormVisible = !this.dialogFormVisible;
28
        }
29
    }
30
  };
31
</script>
32
33
<style lang="stylus" rel="stylesheet/stylus" scoped>
34
  .frmtypeW
35
    float: right
36
  .imageCode
37
    width: 70%
38
  .dialog-footer
39
    text-align: center
40
</style>

+ 128 - 0
src/views/logforms/enteringRegister.vue

@ -0,0 +1,128 @@
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
        <p class="form-title">欢迎入驻平台</p>
8
        <p class="promptText">请先绑定手机并设置密码</p>
9
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
10
          <el-form-item prop="phone">
11
            <el-input v-model="ruleForm.phone" placeholder="请输入手机号码"></el-input>
12
          </el-form-item>
13
          <el-form-item prop="pass">
14
            <el-input type="password" v-model="ruleForm.pass" placeholder="请输入登录密码" auto-complete="off"></el-input>
15
          </el-form-item>
16
          <el-form-item prop="mail">
17
            <el-input v-model="ruleForm.mail" placeholder="请输入短信验证码" class='codeWidth'></el-input>
18
            <el-button type="primary" class='codeWidth codeButton'>获取短信验证码</el-button>
19
          </el-form-item>
20
           <el-form-item>
21
             <i class="el-icon-check successSelect"></i><span class="protocol">我已阅读并同意<a href='#/loginPlat'>《邢台科技条件平台用户协议》</a></span>
22
           </el-form-item>
23
          <el-form-item>
24
            <el-button type="primary" :disabled="isDisabl" :loading="logining" @click="submitForm('ruleForm')">绑定</el-button>
25
          </el-form-item>
26
        </el-form>
27
      </div>
28
    </div>
29
    <Captcha ref="obj"></Captcha>
30
  </div>
31
</template>
32
33
<script type="text/ecmascript-6">
34
  import httpUrl from '@/libs/http';
35
  import Captcha from './Captcha.vue';
36
37
  export default {
38
     data() {
39
      return {
40
        isActive: true,
41
        ActiveNumber: 1,
42
        activeName: 'second',
43
        logining: false,
44
        isDisabl: false,
45
        ruleForm: {
46
          mail: '',
47
          pass: ''
48
        },
49
        rules: {
50
          mail: [
51
            { required: true, message: '请输入邮箱账号', trigger: 'blur' },
52
            { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
53
          ],
54
          pass: [
55
            { required: true, message: '请输入登录密码', trigger: 'blur' },
56
            { min: 6, max: 24, message: '密码由6-24个字符组成,区分大小写', trigger: 'blur' }
57
          ]
58
        }
59
      };
60
    },
61
    components: {
62
      Captcha
63
    },
64
    mounted() {
65
      this.$refs.obj.capShow();
66
    },
67
    methods: {
68
      panelSwitch(event) {
69
       if (event.target.className.includes('tablePanelActive')) {
70
         return;
71
       }
72
        this.isActive = !this.isActive;
73
      },
74
      handleClick(tab, event) {
75
        console.log(tab, event);
76
      },
77
      submitForm(formName) {
78
        this.$refs[formName].validate((valid) => {
79
          if (valid) {
80
            this.logining = true;
81
            let paramsData = {
82
              'email': this.ruleForm.mail,
83
              'pw': this.ruleForm.pass
84
            };
85
            this.$axios.post(httpUrl.hQuery.sign.login, paramsData).then(res => {
86
              this.logining = false;
87
              console.log(res);
88
              if (res.success) {
89
                this.$router.push({path: '/WorkHome'});
90
              } else {
91
                let errorCode = [{
92
                  code: -600001,
93
                  msg: '用户不存在'
94
                }, {
95
                  code: -600002,
96
                  msg: '密码不正确'
97
                }, {
98
                  code: -600003,
99
                  msg: '平台信息不存在'
100
                }, {
101
                  code: -600004,
102
                  msg: '用户被禁用'
103
                }];
104
                for (let i = 0; i < errorCode.length; i++) {
105
                  if (res.code === errorCode[i].code) {
106
                    this.$message.error(errorCode[i].msg);
107
                    return;
108
                  };
109
                };
110
              }
111
            }).catch(error => {
112
              console.log(error);
113
            });
114
          } else {
115
            return false;
116
          }
117
        });
118
      },
119
      goBackPwd() {
120
        this.$router.push({path: '/findPwd'});
121
      }
122
    }
123
  };
124
</script>
125
126
<style lang="stylus" rel="stylesheet/stylus" scoped>
127
  @import './style';
128
</style>

+ 8 - 33
src/views/logforms/findPwd.vue

@ -3,11 +3,10 @@
3 3
    <div class="logo-wrapper"></div>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6
        <p class="form-title">找回密码</p>
6
        <p class="form-title">密码重置</p>
7 7
        <div class="step-wrapper">
8 8
          <el-steps :active="stepVal" finish-status="success" align-center>
9
            <el-step title="输入邮箱"></el-step>
10
            <el-step title="接收密码找回邮件"></el-step>
9
            <el-step title="验证手机"></el-step>
11 10
            <el-step title="重置密码"></el-step>
12 11
          </el-steps>
13 12
        </div>
@ -15,24 +14,15 @@
15 14
        <div class="step-contain">
16 15
          <el-form v-show="stepFisrt" :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
17 16
            <el-form-item prop="mail">
18
              <el-input v-model="ruleForm.mail" placeholder="请输入邮箱账号"></el-input>
17
              <el-input v-model="ruleForm.mail" placeholder="请输入手机号码"></el-input>
18
            </el-form-item>
19
            <el-form-item prop="mail">
20
              <el-input v-model="ruleForm.mail" placeholder="请输入短信验证码" class='codeWidth'></el-input>
21
              <el-button type="primary" class='codeWidth codeButton'>获取短信验证码</el-button>
19 22
            </el-form-item>
20 23
            <el-form-item></el-form-item>
21 24
            <el-form-item class="textButton-box">
22 25
              <el-button type="primary" :disabled="isDisabl" @click="nextStep('ruleForm')">下一步</el-button>
23
              <el-button class="textButton" type="text" @click="goLogin">又想起来了</el-button>
24
            </el-form-item>
25
          </el-form>
26
          <el-form v-show="stepSecond" class="demo-ruleForm">
27
            <el-form-item>
28
              <p class="importTip">密码找回邮件已发送至:<br />
29
                <span class="mainTip" id="emailShow">{{ruleForm.mail}}</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 26
            </el-form-item>
37 27
          </el-form>
38 28
          <el-form v-show="stepThird" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
@ -44,7 +34,7 @@
44 34
            </el-form-item>
45 35
            <el-form-item></el-form-item>
46 36
            <el-form-item>
47
              <el-button type="primary" :disabled="isDisabl" @click="resetPwd('ruleForm2')">重置密码</el-button>
37
              <el-button type="primary" :disabled="isDisabl" @click="resetPwd('ruleForm2')">确认</el-button>
48 38
            </el-form-item>
49 39
          </el-form>
50 40
        </div>
@ -87,7 +77,6 @@
87 77
        resetCode: '',
88 78
        stepVal: 0,
89 79
        stepFisrt: true,
90
        stepSecond: false,
91 80
        stepThird: false,
92 81
        isDisabl: false,
93 82
        ruleForm: {
@ -119,7 +108,6 @@
119 108
      this.resetCode = util.urlParse('sc');
120 109
      if (this.resetStepNum === '2') {
121 110
        this.stepFisrt = false;
122
        this.stepSecond = false;
123 111
        this.stepThird = true;
124 112
        this.stepVal = 2;
125 113
      }
@ -136,7 +124,6 @@
136 124
              console.log(res);
137 125
              if (res.success) {
138 126
                this.stepFisrt = false;
139
                this.stepSecond = true;
140 127
                this.stepVal = 1;
141 128
              } else {
142 129
                let errorCode = [{
@ -159,14 +146,6 @@
159 146
          }
160 147
        });
161 148
      },
162
      goToMail() {
163
        var url = this.ruleForm.mail.split('@')[1];
164
        if (util.mailHash[url] === undefined) {
165
          window.open('http://mail.' + url);
166
        } else {
167
          window.open(util.mailHash[url]);
168
        }
169
      },
170 149
      resetPwd(formName) {
171 150
        this.$refs[formName].validate((valid) => {
172 151
          if (valid) {
@ -195,7 +174,6 @@
195 174
                    callback: action => {
196 175
                      if (action === 'confirm') {
197 176
                        this.stepFisrt = true;
198
                        this.stepSecond = false;
199 177
                        this.stepThird = false;
200 178
                        this.stepVal = 0;
201 179
                      };
@ -209,9 +187,6 @@
209 187
            return false;
210 188
          }
211 189
        });
212
      },
213
      goLogin() {
214
        this.$router.push({path: '/loginPlat'});
215 190
      }
216 191
    }
217 192
  };

+ 42 - 1
src/views/logforms/loginPlat.vue

@ -3,8 +3,15 @@
3 3
    <div class="logo-wrapper"></div>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6
        <p class="form-title">登录平台工作台</p>
6
        <p class="form-title">登录</p>
7
        <ul class='table-panel'>
8
          <li class="table-panel-single" v-bind:class="{ tablePanelActive: isActive }" @click="panelSwitch">密码登录</li>
9
          <li class="table-panel-single" v-bind:class="{ tablePanelActive: !isActive }" @click="panelSwitch">邀请码登录</li>
10
        </ul>
7 11
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
12
          <el-form-item prop="phone">
13
            <el-input v-model="ruleForm.phone" placeholder="请输入手机号码"></el-input>
14
          </el-form-item>
8 15
          <el-form-item prop="mail">
9 16
            <el-input v-model="ruleForm.mail" placeholder="请输入邮箱账号"></el-input>
10 17
          </el-form-item>
@ -15,6 +22,7 @@
15 22
          <el-form-item>
16 23
            <el-button type="primary" :disabled="isDisabl" :loading="logining" @click="submitForm('ruleForm')">登录</el-button>
17 24
            <el-button type="text" @click="goBackPwd">忘记密码?</el-button>
25
            <span class='existing-account registerButton'>还没有账号<a href="#/register">立即注册</a></span>
18 26
          </el-form-item>
19 27
        </el-form>
20 28
      </div>
@ -28,6 +36,9 @@
28 36
  export default {
29 37
     data() {
30 38
      return {
39
        isActive: true,
40
        ActiveNumber: 1,
41
        activeName: 'second',
31 42
        logining: false,
32 43
        isDisabl: false,
33 44
        ruleForm: {
@ -47,6 +58,15 @@
47 58
      };
48 59
    },
49 60
    methods: {
61
      panelSwitch(event) {
62
       if (event.target.className.includes('tablePanelActive')) {
63
         return;
64
       }
65
        this.isActive = !this.isActive;
66
      },
67
      handleClick(tab, event) {
68
        console.log(tab, event);
69
      },
50 70
      submitForm(formName) {
51 71
        this.$refs[formName].validate((valid) => {
52 72
          if (valid) {
@ -98,4 +118,25 @@
98 118
99 119
<style lang="stylus" rel="stylesheet/stylus" scoped>
100 120
  @import './style';
121
    .table-panel
122
      border-bottom: 2px solid #ebebeb
123
      margin-bottom: 15px
124
      overflow: hidden
125
      .table-panel-single
126
        height: 40px
127
        line-height: 40px
128
        font-size: 14px
129
        font-weight: 500
130
        color: #303133
131
        cursor: pointer
132
        display: inline-block
133
        &:nth-child(2)
134
          float: right
135
        &:hover
136
          color: #409eff
137
      .tablePanelActive
138
        border-bottom: 2px solid #409eff
139
        color: #409eff
140
    .registerButton
141
      float: right
101 142
</style>

+ 127 - 0
src/views/logforms/register.vue

@ -0,0 +1,127 @@
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
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
8
          <el-form-item prop="phone">
9
            <el-input v-model="ruleForm.phone" 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 prop="mail">
15
            <el-input v-model="ruleForm.mail" placeholder="请输入短信验证码" class='codeWidth'></el-input>
16
            <el-button type="primary" class='codeWidth codeButton'>获取短信验证码</el-button>
17
          </el-form-item>
18
           <el-form-item>
19
             <i class="el-icon-check successSelect"></i><span class="protocol">我已阅读并同意<a href='#/loginPlat'>《邢台科技条件平台用户协议》</a></span>
20
           </el-form-item>
21
          <el-form-item>
22
            <el-button type="primary" :disabled="isDisabl" :loading="logining" @click="submitForm('ruleForm')">注册</el-button>
23
            <div class='existing-account'>已有账号<a href="#/loginPlat">立即登录</a></div>
24
          </el-form-item>
25
        </el-form>
26
      </div>
27
    </div>
28
    <Captcha ref="obj"></Captcha>
29
  </div>
30
</template>
31
32
<script type="text/ecmascript-6">
33
  import httpUrl from '@/libs/http';
34
  import Captcha from './Captcha.vue';
35
36
  export default {
37
     data() {
38
      return {
39
        isActive: true,
40
        ActiveNumber: 1,
41
        activeName: 'second',
42
        logining: false,
43
        isDisabl: false,
44
        ruleForm: {
45
          mail: '',
46
          pass: ''
47
        },
48
        rules: {
49
          mail: [
50
            { required: true, message: '请输入邮箱账号', trigger: 'blur' },
51
            { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
52
          ],
53
          pass: [
54
            { required: true, message: '请输入登录密码', trigger: 'blur' },
55
            { min: 6, max: 24, message: '密码由6-24个字符组成,区分大小写', trigger: 'blur' }
56
          ]
57
        }
58
      };
59
    },
60
    components: {
61
      Captcha
62
    },
63
    mounted() {
64
      this.$refs.obj.capShow();
65
    },
66
    methods: {
67
      panelSwitch(event) {
68
       if (event.target.className.includes('tablePanelActive')) {
69
         return;
70
       }
71
        this.isActive = !this.isActive;
72
      },
73
      handleClick(tab, event) {
74
        console.log(tab, event);
75
      },
76
      submitForm(formName) {
77
        this.$refs[formName].validate((valid) => {
78
          if (valid) {
79
            this.logining = true;
80
            let paramsData = {
81
              'email': this.ruleForm.mail,
82
              'pw': this.ruleForm.pass
83
            };
84
            this.$axios.post(httpUrl.hQuery.sign.login, paramsData).then(res => {
85
              this.logining = false;
86
              console.log(res);
87
              if (res.success) {
88
                this.$router.push({path: '/WorkHome'});
89
              } else {
90
                let errorCode = [{
91
                  code: -600001,
92
                  msg: '用户不存在'
93
                }, {
94
                  code: -600002,
95
                  msg: '密码不正确'
96
                }, {
97
                  code: -600003,
98
                  msg: '平台信息不存在'
99
                }, {
100
                  code: -600004,
101
                  msg: '用户被禁用'
102
                }];
103
                for (let i = 0; i < errorCode.length; i++) {
104
                  if (res.code === errorCode[i].code) {
105
                    this.$message.error(errorCode[i].msg);
106
                    return;
107
                  };
108
                };
109
              }
110
            }).catch(error => {
111
              console.log(error);
112
            });
113
          } else {
114
            return false;
115
          }
116
        });
117
      },
118
      goBackPwd() {
119
        this.$router.push({path: '/findPwd'});
120
      }
121
    }
122
  };
123
</script>
124
125
<style lang="stylus" rel="stylesheet/stylus" scoped>
126
  @import './style';
127
</style>

+ 27 - 1
src/views/logforms/style.styl

@ -31,9 +31,35 @@
31 31
        line-height: 36px
32 32
        color:$mainColor
33 33
        text-align:center
34
        margin-bottom:40px
35 34
      .el-button--primary
36 35
        width:100%
36
      .codeWidth
37
        width: 65%
38
        float: left
39
      .codeButton
40
        width: 30%
41
        margin-left: 20px
42
      .successSelect
43
        display: inline-block
44
        width: 15px
45
        height: 15px
46
        background-color: #409eff
47
        color: #fff
48
        margin-right: 15px
49
      .protocol
50
        font-size: 14px
51
        a
52
          color: #409eff
53
      .promptText
54
        text-align: center
55
        font-size: 14px
56
        margin: 20px 0
57
        color: #606266
58
      .existing-account
59
        text-align: right
60
        a
61
          color: #409eff
62
          margin-left: 15px
37 63
38 64
  .step-wrapper
39 65
    margin-bottom:30px

+ 23 - 0
src/views/personalCenter/attentionCollect.vue

@ -0,0 +1,23 @@
1
<template>
2
  <el-tabs v-model="activeName" @tab-click="handleClick">
3
    <el-tab-pane label="专家" name="first">专家</el-tab-pane>
4
    <el-tab-pane label="机构" name="second">机构</el-tab-pane>
5
    <el-tab-pane label="服务" name="third">服务</el-tab-pane>
6
    <el-tab-pane label="资源" name="fourth">资源</el-tab-pane>
7
    <el-tab-pane label="专利" name="fiveth">专利</el-tab-pane>
8
  </el-tabs>
9
</template>
10
<script>
11
  export default {
12
    data() {
13
      return {
14
        activeName: 'second'
15
      };
16
    },
17
    methods: {
18
      handleClick(tab, event) {
19
        console.log(tab, event);
20
      }
21
    }
22
  };
23
</script>

+ 105 - 0
src/views/personalCenter/common/index.vue

@ -0,0 +1,105 @@
1
<template>
2
  <div class="main-content">
3
    <div class="boxLeft">
4
        <div class="headPhoto">
5
          <div class="userInfo">
6
            <img src="../../logforms/img/e-sign-on_bg_img_nor.png" alt="">
7
            <p>专家姓名</p>
8
          </div>
9
        </div>
10
         <el-menu
11
      default-active="modifyData"
12
      router
13
      class="el-menu-vertical-demo"
14
      @select="handleSelect"
15
      @open="handleOpen"
16
      @close="handleClose">
17
       <el-menu-item index="modifyData">
18
        <i class="el-icon-menu"></i>
19
        <span slot="title">修改资料</span>
20
      </el-menu-item>
21
      <el-submenu index="demand">
22
        <template slot="title">
23
          <i class="el-icon-location"></i>
24
          <span>我的需求</span>
25
        </template>
26
         <el-menu-item index="myDemand">我的需求</el-menu-item>
27
        <el-menu-item index="modifyDemand">修改需求</el-menu-item>
28
        <el-menu-item index="examineDemand">查看需求</el-menu-item>
29
      </el-submenu>
30
      <el-submenu index="2">
31
        <template slot="title">
32
          <i class="el-icon-location"></i>
33
          <span>我的企业</span>
34
        </template>
35
        <el-menu-item index="companyInformation">企业信息</el-menu-item>
36
        <el-menu-item index="companyProduct">企业产品</el-menu-item>
37
         <el-menu-item index="publishProduct">发布产品</el-menu-item>
38
      </el-submenu>
39
      <el-menu-item index="attentionCollect">
40
        <i class="el-icon-menu"></i>
41
        <span slot="title">关注收藏</span>
42
      </el-menu-item>
43
      <el-menu-item index="modifyPassword">
44
        <i class="el-icon-setting"></i>
45
        <span slot="title">账户设置</span>
46
      </el-menu-item>
47
    </el-menu>
48
    </div>
49
    <div class="boxRight">
50
      <transition name="fade" mode="out-in">
51
        <router-view></router-view>
52
      </transition>
53
    </div>
54
  </div>
55
</template>
56
57
<script>
58
  export default {
59
    data() {
60
      return {
61
      };
62
    },
63
    created() {
64
    },
65
    methods: {
66
      handleSelect(key, keyPath) {
67
        console.log(key, keyPath);
68
      },
69
      handleOpen(key, keyPath) {
70
        console.log(key, keyPath);
71
      },
72
      handleClose(key, keyPath) {
73
        console.log(key, keyPath);
74
      }
75
    }
76
  };
77
</script>
78
79
<style lang="stylus" rel="stylesheet/stylus" scoped>
80
  .boxRight
81
    float: left
82
    width: 900px
83
    margin-left: 15px
84
    box-sizing: border-box
85
  .boxLeft
86
    float: left
87
    overflow: hidden
88
    width: 200px
89
    .headPhoto
90
      height: 146px
91
      margin-bottom: 10px
92
      border: 1px solid #ebebeb
93
      display: flex
94
      justify-content: center
95
      align-items: center
96
      .userInfo
97
        text-align: center
98
        color: #606266
99
        p
100
          margin-top: 10px
101
        img
102
          width: 80px
103
          height: 80px
104
          border-radius: 50%
105
</style>

+ 197 - 0
src/views/personalCenter/modifyData.vue

@ -0,0 +1,197 @@
1
<template>
2
  <div>
3
    <el-tabs>
4
      <el-tab-pane label="修改资料"></el-tab-pane>
5
    </el-tabs>
6
    <div class='formHeadFormBox'>
7
      <div class='formBox'>
8
        <el-form :model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2" label-width="80px" class="demo-ruleForm">
9
            <el-form-item label="用户名" prop="pass">
10
                <el-input v-model="ruleForm2.pass" autocomplete="off" placeholder="请输入用户名"></el-input>
11
            </el-form-item>
12
            <el-form-item label="真实姓名" prop="checkPass">
13
                <el-input v-model="ruleForm2.checkPass" autocomplete="off" placeholder="请输入真实姓名"></el-input>
14
            </el-form-item>
15
            <el-form-item label="性别">
16
                <el-select v-model="ruleForm2.region" placeholder="请选择性别" style="width:100%">
17
                <el-option label="男" value="shanghai"></el-option>
18
                <el-option label="女" value="beijing"></el-option>
19
                </el-select>
20
            </el-form-item>
21
            <el-form-item label="职位" prop="age">
22
                <el-input v-model.number="ruleForm2.age" placeholder="请输入职位"></el-input>
23
            </el-form-item>
24
            <el-form-item label="所在机构" prop="age">
25
                <el-input v-model.number="ruleForm2.age" placeholder="请输入所在机构"></el-input>
26
            </el-form-item>
27
            <el-form-item label="联系电话" prop="age">
28
                <el-input v-model.number="ruleForm2.age" placeholder="请输入联系电话"></el-input>
29
            </el-form-item>
30
            <el-form-item label="联系邮箱" prop="age">
31
                <el-input v-model.number="ruleForm2.age" placeholder="请输入联系邮箱"></el-input>
32
            </el-form-item>
33
            <CityPick ref="cityPick"  :widthselect="206" :prov="ruleForm2.province" :city="ruleForm2.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
34
            <el-form-item style="text-align:right">
35
                <el-button type="primary" @click="submitForm('ruleForm2')">保存修改</el-button>
36
            </el-form-item>
37
        </el-form>
38
      </div>
39
      <div class="headPhotoBox">
40
        <el-upload
41
        class="avatar-uploader"
42
        action="https://jsonplaceholder.typicode.com/posts/"
43
        :show-file-list="false"
44
        :on-success="handleAvatarSuccess"
45
        :before-upload="beforeAvatarUpload">
46
        <img v-if="imageUrl" :src="imageUrl" class="avatar">
47
        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
48
      </el-upload>
49
      <p>上传头像</p>
50
      </div>
51
    </div>
52
  </div>
53
</template>
54
55
<script>
56
  export default {
57
    data() {
58
      var checkAge = (rule, value, callback) => {
59
        if (!value) {
60
          return callback(new Error('年龄不能为空'));
61
        }
62
        setTimeout(() => {
63
          if (!Number.isInteger(value)) {
64
            callback(new Error('请输入数字值'));
65
          } else {
66
            if (value < 18) {
67
              callback(new Error('必须年满18岁'));
68
            } else {
69
              callback();
70
            }
71
          }
72
        }, 1000);
73
      };
74
      var validatePass = (rule, value, callback) => {
75
        if (value === '') {
76
          callback(new Error('请输入密码'));
77
        } else {
78
          if (this.ruleForm2.checkPass !== '') {
79
            this.$refs.ruleForm2.validateField('checkPass');
80
          }
81
          callback();
82
        }
83
      };
84
      var validatePass2 = (rule, value, callback) => {
85
        if (value === '') {
86
          callback(new Error('请再次输入密码'));
87
        } else if (value !== this.ruleForm2.pass) {
88
          callback(new Error('两次输入密码不一致!'));
89
        } else {
90
          callback();
91
        }
92
      };
93
      return {
94
        imageUrl: '',
95
        ruleForm2: {
96
          pass: '',
97
          checkPass: '',
98
          age: '',
99
          region: '',
100
          province: '',
101
          city: ''
102
        },
103
        rules2: {
104
          pass: [
105
            { validator: validatePass, trigger: 'blur' }
106
          ],
107
          checkPass: [
108
            { validator: validatePass2, trigger: 'blur' }
109
          ],
110
          age: [
111
            { validator: checkAge, trigger: 'blur' }
112
          ]
113
        }
114
      };
115
    },
116
    methods: {
117
     handleAvatarSuccess(res, file) {
118
        this.imageUrl = URL.createObjectURL(file.raw);
119
      },
120
      beforeAvatarUpload(file) {
121
        const isJPG = file.type === 'image/jpeg';
122
        const isLt2M = file.size / 1024 / 1024 < 2;
123
124
        // if (!isJPG) {
125
        //   this.$message.error('上传头像图片只能是 JPG 格式!');
126
        // }
127
        // if (!isLt2M) {
128
        //   this.$message.error('上传头像图片大小不能超过 2MB!');
129
        // }
130
        return isJPG && isLt2M;
131
      },
132
      getSelectProv(prov) {
133
        this.ruleForm2.province = prov;
134
      },
135
      getSelectCity(city) {
136
        this.ruleForm2.city = city;
137
      },
138
      submitForm(formName) {
139
        this.$refs[formName].validate((valid) => {
140
          if (valid) {
141
            alert('submit!');
142
          } else {
143
            console.log('error submit!!');
144
            return false;
145
          }
146
        });
147
      },
148
      resetForm(formName) {
149
        this.$refs[formName].resetFields();
150
      }
151
    }
152
  };
153
</script>
154
155
<style>
156
    .formHeadFormBox {
157
      margin-left: 20px;
158
      position: relative;
159
    }
160
    .formBox {
161
      width: 500px;
162
    }
163
    .headPhotoBox {
164
      position: absolute;
165
      right: 90px;
166
      top: 0px;
167
    }
168
    .headPhotoBox p {
169
        text-align: center;
170
        line-height: 30px;
171
        color: #606266;
172
        font-size: 14px
173
    }
174
  .avatar-uploader .el-upload {
175
    border: 1px dashed #d9d9d9;
176
    border-radius: 6px;
177
    cursor: pointer;
178
    position: relative;
179
    overflow: hidden;
180
  }
181
  .avatar-uploader .el-upload:hover {
182
    border-color: #409EFF;
183
  }
184
  .avatar-uploader-icon {
185
    font-size: 28px;
186
    color: #8c939d;
187
    width: 178px;
188
    height: 178px;
189
    line-height: 178px;
190
    text-align: center;
191
  }
192
  .avatar {
193
    width: 178px;
194
    height: 178px;
195
    display: block;
196
  }
197
</style>

+ 115 - 0
src/views/personalCenter/modifyPassword.vue

@ -0,0 +1,115 @@
1
<template>
2
  <div>
3
    <el-tabs>
4
      <el-tab-pane label="修改密码"></el-tab-pane>
5
    </el-tabs>
6
    <div class="formBoxCenter">
7
         <a href="#/findPwd">忘记密码?</a>
8
        <div class="boxCenter">
9
          <el-form :model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">
10
            <el-form-item label="原密码" prop="pass">
11
                <el-input type="password" v-model="ruleForm2.pass" autocomplete="off" placeholder="请输入原密码"></el-input>
12
            </el-form-item>
13
            <el-form-item label="新密码" prop="checkPass">
14
                <el-input type="password" v-model="ruleForm2.checkPass" autocomplete="off" placeholder="请输入新密码"></el-input>
15
            </el-form-item>
16
            <el-form-item label="再次输入" prop="age">
17
                <el-input v-model.number="ruleForm2.age"></el-input>
18
            </el-form-item>
19
            <el-form-item style="text-align:center">
20
                <el-button type="primary" @click="submitForm('ruleForm2')">保存修改</el-button>
21
            </el-form-item>
22
        </el-form>
23
      </div>
24
    </div>
25
  </div>
26
</template>
27
<script>
28
  export default {
29
    data() {
30
      var checkAge = (rule, value, callback) => {
31
        if (!value) {
32
          return callback(new Error('年龄不能为空'));
33
        }
34
        setTimeout(() => {
35
          if (!Number.isInteger(value)) {
36
            callback(new Error('请输入数字值'));
37
          } else {
38
            if (value < 18) {
39
              callback(new Error('必须年满18岁'));
40
            } else {
41
              callback();
42
            }
43
          }
44
        }, 1000);
45
      };
46
      var validatePass = (rule, value, callback) => {
47
        if (value === '') {
48
          callback(new Error('请输入密码'));
49
        } else {
50
          if (this.ruleForm2.checkPass !== '') {
51
            this.$refs.ruleForm2.validateField('checkPass');
52
          }
53
          callback();
54
        }
55
      };
56
      var validatePass2 = (rule, value, callback) => {
57
        if (value === '') {
58
          callback(new Error('请再次输入密码'));
59
        } else if (value !== this.ruleForm2.pass) {
60
          callback(new Error('两次输入密码不一致!'));
61
        } else {
62
          callback();
63
        }
64
      };
65
      return {
66
        ruleForm2: {
67
          pass: '',
68
          checkPass: '',
69
          age: ''
70
        },
71
        rules2: {
72
          pass: [
73
            { validator: validatePass, trigger: 'blur' }
74
          ],
75
          checkPass: [
76
            { validator: validatePass2, trigger: 'blur' }
77
          ],
78
          age: [
79
            { validator: checkAge, trigger: 'blur' }
80
          ]
81
        }
82
      };
83
    },
84
    methods: {
85
      submitForm(formName) {
86
        this.$refs[formName].validate((valid) => {
87
          if (valid) {
88
            alert('submit!');
89
          } else {
90
            console.log('error submit!!');
91
            return false;
92
          }
93
        });
94
      },
95
      resetForm(formName) {
96
        this.$refs[formName].resetFields();
97
      }
98
    }
99
  };
100
</script>
101
102
<style lang="stylus" rel="stylesheet/stylus" scoped>
103
  .formBoxCenter
104
    display:flex
105
    align-items: center
106
    justify-content: center
107
    .boxCenter
108
      width: 450px
109
      position: relative
110
    a
111
      position: absolute
112
      top: 60px
113
      right: 140px
114
      color: #409EFF
115
</style>

+ 1 - 0
src/views/personalCenter/myBusiness/companyInformation.vue

@ -0,0 +1 @@
1
<template> <div>企业信息</div></template>

+ 1 - 0
src/views/personalCenter/myBusiness/companyProduct.vue

@ -0,0 +1 @@
1
<template> <div>企业产品</div></template>

+ 1 - 0
src/views/personalCenter/myBusiness/publishProduct.vue

@ -0,0 +1 @@
1
<template> <div>发布产品</div></template>

+ 1 - 0
src/views/personalCenter/myNeeds/examineDemand.vue

@ -0,0 +1 @@
1
<template> <div>查看需求</div></template>

+ 3 - 0
src/views/personalCenter/myNeeds/index.vue

@ -0,0 +1,3 @@
1
<template>
2
  <router-view></router-view>
3
</template>

+ 1 - 0
src/views/personalCenter/myNeeds/modifyDemand.vue

@ -0,0 +1 @@
1
<template> <div>修改需求</div></template>

+ 1 - 0
src/views/personalCenter/myNeeds/myNeed.vue

@ -0,0 +1 @@
1
<template> <div>我的需求</div></template>