Browse Source

工作台用户页面优化

codeMan 1 year ago
parent
commit
e003025353

+ 2 - 0
cloud/businessCard/edit.vue

@@ -345,6 +345,8 @@ export default {
                         uni.navigateBack()
 
                     }
+                    //刷新首页用户信息
+                    this.$Http.refreshUserInfoData && this.$Http.refreshUserInfoData()
                 })
             })
         },

+ 4 - 0
cloud/businessCard/index.vue

@@ -155,6 +155,9 @@ export default {
     },
     computed: {
     },
+    onUnload () {
+        delete this.$Http.refreshUserInfoData
+    },
     methods: {
         preview(url) {
             viewImage(url)
@@ -172,6 +175,7 @@ export default {
                     userid: id
                 },
             })
+            if (this.cutoff(res.msg)) return
             this.userInfo = res.data
             this.userInfo.headpic = this.userInfo.attinfos.find(v => v.usetype == "headportrait") && this.userInfo.attinfos.find(v => v.usetype == "headportrait").url || '';
             this.userInfo.images = this.userInfo.attinfos.filter(v => v.usetype != "headportrait")

+ 10 - 4
pages/index/cloud/userInfo.vue

@@ -15,7 +15,7 @@
       </view>
       <view class="userinfo-right">
           <navigator :url="isCode?'/cloud/businessCard/index':'/cloud/businessCard/edit?origin=my&id='+userInfoValue.userid" class="info-card" @click="goEdit">
-              <image class="image" src="/static/workbench/个人名片.svg" mode="widthFix"></image>
+              <image class="image" src="/static/workbench/个人名片.svg" mode="widthFix" ></image>
               <text class="title">{{isCode?'个人名片':'个人信息'}}</text>
           </navigator>
           <contact>
@@ -34,8 +34,8 @@
 
 <script>
 import contact from "../../../components/contact"
-export default {
-    components:{contact},
+export default {    
+  components:{contact},
   props:{
     isCode: {
       type:Boolean,
@@ -56,6 +56,9 @@ export default {
             this.$emit('upData',id)
             delete this.$Http.editUser
         }.bind(this)
+        this.$emit('selfCardClick')
+    },
+    selfCardClick () {
     }
   },
 }
@@ -131,8 +134,11 @@ export default {
         font-family: Source Han Sans SC, Source Han Sans SC;
         .info-card {
             cursor: pointer;
+            border-radius: 5px;
+            box-sizing: border-box;
+            padding: 5px;
             &:nth-child(1),&:nth-child(2) {
-                margin-right: 23px;
+                margin-right: 5px;
             }
             display: flex;
             flex-direction: column;

+ 7 - 2
pages/index/cloud/workbench.vue

@@ -7,7 +7,7 @@
             </view>
         </view>
         <!-- 用户信息 -->
-        <UserInfo :userInfoValue="userInfoValue"></UserInfo>
+        <UserInfo :userInfoValue="userInfoValue" @selfCardClick="selfCardClick"></UserInfo>
 
         <view class="work-panel_signin">
             <text class="title">你已累计打卡{{ userInfoValue.signdays }}天</text>
@@ -79,7 +79,12 @@ export default {
         }
     },
     methods: {
-
+        selfCardClick () {
+            this.$Http.refreshUserInfoData = function () {
+                this.getUserInfo()
+                delete this.$Http.refreshUserInfoData
+            }.bind(this)
+        },
         init(callBack) {
             callBack()
             this.list = Object.values(uni.getStorageSync('authList').工作台)