xuqiang 4 лет назад
Родитель
Сommit
7645c2de99

+ 9 - 3
src/main/pc-space/src/components/FansInfo.vue

@@ -1,20 +1,22 @@
 <template>
     <div class="container">
         <div class="top"></div>
+        <!-- <img class="top" :src="userInfo.avatar" alt="" /> -->
         <div class="top1">
             <div class="title" @click="Fans">
-                <div class="title1">333</div>
+                <div class="title1">{{ userInfo.follows }}</div>
                 <div class="title2" :class="{ active }">粉丝</div>
             </div>
-            <img class="img2" src="../assets/img/888.jpg" alt="" />
+            <img class="img2" :src="userInfo.avatar" alt="" />
             <div class="title">
-                <div class="title1">2</div>
+                <div class="title1">{{ userInfo.followers }}</div>
                 <div class="title2">关注</div>
             </div>
         </div>
     </div>
 </template>
 <script>
+import { mapState } from 'vuex';
 export default {
     data() {
         return {
@@ -26,6 +28,9 @@ export default {
         Fans() {
             this.$router.push('/fans');
         }
+    },
+    computed: {
+        ...mapState(['userInfo'])
     }
 };
 </script>
@@ -33,6 +38,7 @@ export default {
 .container {
     .top {
         height: 146px;
+        width: 100%;
         background: #00ffcb;
     }
     .top1 {

+ 25 - 5
src/main/pc-space/src/components/PageHeader.vue

@@ -15,13 +15,15 @@
                         <div class="slip" :class="{ active: item === active }"></div>
                     </div>
                 </div>
-                <div class="btn-list" v-if="!isLogin">
+                <div class="btn-list" v-if="isLogin">
                     <el-dropdown @command="onCommand" style="margin-left: 20px" trigger="click">
                         <span class="el-dropdown-link">
                             <img class="img" :src="avatarBox" />
                         </span>
                         <el-dropdown-menu slot="dropdown">
-                            <el-dropdown-item command="nickname" style="word-break: keep-all">1111 </el-dropdown-item>
+                            <el-dropdown-item command="nickname" style="word-break: keep-all"
+                                >{{ userInfo.username }}
+                            </el-dropdown-item>
                             <div class="border1"></div>
                             <el-dropdown-item command="supply" style="word-break: keep-all">去认证 </el-dropdown-item>
                             <el-dropdown-item command="edit" style="word-break: keep-all">编辑资料 </el-dropdown-item>
@@ -52,8 +54,8 @@ export default {
     computed: {
         ...mapState(['userInfo']),
         avatarBox() {
-            return this.userInfo
-                ? this.userInfo
+            return this.userInfo.avatar
+                ? this.userInfo.avatar
                 : 'https://zhirongip.oss-cn-hangzhou.aliyuncs.com/image/2021-06-30-17-02-42uzAOUPcw.jpeg';
         }
     },
@@ -81,7 +83,6 @@ export default {
                 this.$router.push('/accountdata');
             } else if (command === 'logout') {
                 localStorage.removeItem('webToken');
-                this.updateUserInfo(null);
                 this.$router.push('/');
             }
         }
@@ -89,10 +90,28 @@ export default {
 };
 </script>
 <style lang="less" scoped>
+/deep/ .el-dropdown-menu__item {
+    font-weight: bold;
+    text-align: center;
+}
+.border1 {
+    margin: 6px 16px;
+    height: 1px;
+    background: #f2f3f5;
+}
 .container {
     height: 90px;
     background: #0f1111;
     width: 100%;
+    // /deep/ .el-tabs__nav-scroll {
+    //     padding-left: 13px;
+    // }
+    // /deep/ .el-tabs__item {
+    //     font-weight: bold;
+    //     font-size: 14px;
+    //     width: 300px;
+    // }
+
     .header {
         display: flex;
         align-items: center;
@@ -141,6 +160,7 @@ export default {
                     display: block;
                 }
             }
+
             .login {
                 width: 83px;
                 height: 30px;

+ 2 - 1
src/main/pc-space/src/views/Index.vue

@@ -9,7 +9,8 @@
                 v-if="
                     this.$route.name !== 'security' &&
                     this.$route.name !== 'authentication' &&
-                    this.$route.name !== 'userauthentication'
+                    this.$route.name !== 'userauthentication' &&
+                    this.$route.name !== 'enterpriseauthentication'
                 "
             >
                 <div class="footer center-content">

+ 12 - 5
src/main/pc-space/src/views/user/AccountData.vue

@@ -9,7 +9,7 @@
                         <span class="el-icon-user"></span>
                     </div>
                     <div class="text2">昵称</div>
-                    <div class="text3">中国</div>
+                    <div class="text3">{{ userInfo.username }}</div>
                 </div>
                 <div class="text4">修改</div>
             </div>
@@ -19,7 +19,7 @@
                         <span class="el-icon-price-tag"></span>
                     </div>
                     <div class="text2">编码</div>
-                    <div class="text3">中国</div>
+                    <div class="text3">{{ userInfo.id }}</div>
                 </div>
                 <div class="text4">修改</div>
             </div>
@@ -41,7 +41,7 @@
                         <span class="el-icon-message"></span>
                     </div>
                     <div class="text2">邮箱</div>
-                    <div class="text3">中国</div>
+                    <div class="text3">{{ userInfo.email || '暂无' }}</div>
                 </div>
                 <div class="text4">修改</div>
             </div>
@@ -53,7 +53,7 @@
                         <span class="el-icon-mobile-phone"></span>
                     </div>
                     <div class="text2">登录账号</div>
-                    <div class="text3">中国</div>
+                    <div class="text3">{{ Phone }}</div>
                 </div>
                 <div class="text4" @click="Security">修改</div>
             </div>
@@ -63,7 +63,7 @@
                         <span class="el-icon-lock"></span>
                     </div>
                     <div class="text2">登录密码</div>
-                    <div class="text3">中国</div>
+                    <div class="text3">********</div>
                 </div>
                 <div class="text4">修改</div>
             </div>
@@ -93,12 +93,19 @@
     </div>
 </template>
 <script>
+import { mapState } from 'vuex';
 import FansInfo from '../../components/FansInfo.vue';
 export default {
     components: { FansInfo },
     data() {
         return {};
     },
+    computed: {
+        ...mapState(['userInfo']),
+        Phone() {
+            return this.userInfo.phone.slice(0, 2) + ' ******* ' + this.userInfo.phone.slice(9, 11);
+        }
+    },
     methods: {
         Security() {
             this.$router.push('/security');

+ 1 - 10
src/main/pc-space/src/views/user/EnterpriseAuthentication.vue

@@ -12,14 +12,6 @@
                         v-model="sizeForm.nickname"
                     ></el-input>
                 </el-form-item>
-                <!-- <el-form-item label="手机号码" prop="phone">
-                    <el-input
-                        style="width: 300px"
-                        placeholder="请输入您的联系方式"
-                        :disabled="true"
-                        v-model="sizeForm.phone"
-                    ></el-input>
-                </el-form-item> -->
 
                 <el-form-item label="本人身份证 (正面图)" prop="photoFront">
                     <single-upload class="upload" v-model="sizeForm.photoFront"></single-upload>
@@ -65,7 +57,6 @@ export default {
                 photoBackside: '',
                 phone: '',
                 email: '',
-                avatar: 'https://zhirongip.oss-cn-hangzhou.aliyuncs.com/image/2021-06-30-17-02-42uzAOUPcw.jpeg',
                 type: 'ID_CARD'
             },
             typeFl: {},
@@ -155,7 +146,7 @@ export default {
                         this.sizeForm = res;
                         this.saving = false;
                         this.$store.dispatch('getUserInfo');
-                        this.$router.push('/Authentication');
+                        // this.$router.push('/Authentication');
                     });
                 })
                 .catch(e => {

+ 19 - 19
src/main/pc-space/src/views/user/Security.vue

@@ -21,7 +21,7 @@
                     :rules="rules"
                 >
                     <el-form-item label="当前手机号" prop="phone">
-                        <div class="phone">156****8686</div>
+                        <div class="phone">{{ Phone }}</div>
                     </el-form-item>
                     <el-form-item label="验证码" prop="code">
                         <el-input style="width: 300px" v-model="ruleForm.code" placeholder="请输入4位验证码">
@@ -82,10 +82,10 @@ export default {
         };
     },
     computed: {
-        ...mapState(['userInfo'])
-        // Phone() {
-        //     return this.userInfo.phone.slice(0, 3) + ' **** ' + this.userInfo.phone.slice(7, 11);
-        // }
+        ...mapState(['userInfo']),
+        Phone() {
+            return this.userInfo.phone.slice(0, 3) + ' **** ' + this.userInfo.phone.slice(7, 11);
+        }
     },
     // created() {
     //     this.ruleForm.phone = this.userInfo.phone;
@@ -95,20 +95,20 @@ export default {
             this.sendMsg(this.ruleForm.phone);
         },
         codeSend() {
-            this.flag = false;
-            // this.$http
-            //     .get('/sms/verify', {
-            //         phone: this.ruleForm.phone,
-            //         code: this.ruleForm.code
-            //     })
-            //     .then(() => {
-            //         this.ruleForm.code = '';
-            //         this.ruleForm.phone = '';
-            //         this.flag = false;
-            //     })
-            //     .catch(e => {
-            //         this.$message.error(e.error);
-            //     });
+            // this.flag = false;
+            this.$http
+                .get('/sms/verify', {
+                    phone: this.ruleForm.phone,
+                    code: this.ruleForm.code
+                })
+                .then(() => {
+                    this.ruleForm.code = '';
+                    this.ruleForm.phone = '';
+                    this.flag = false;
+                })
+                .catch(e => {
+                    this.$message.error(e.error);
+                });
         },
         Jump() {
             this.flag = true;

+ 1 - 2
src/main/pc-space/src/views/user/UserAuthentication.vue

@@ -60,7 +60,6 @@ export default {
                 photoBackside: '',
                 phone: '',
                 email: '',
-                avatar: 'https://zhirongip.oss-cn-hangzhou.aliyuncs.com/image/2021-06-30-17-02-42uzAOUPcw.jpeg',
                 type: 'ID_CARD'
             },
             typeFl: {},
@@ -150,7 +149,7 @@ export default {
                         this.sizeForm = res;
                         this.saving = false;
                         this.$store.dispatch('getUserInfo');
-                        this.$router.push('/Authentication');
+                        // this.$router.push('/Authentication');
                     });
                 })
                 .catch(e => {