Browse Source

切换账号

zhaoxiaohai 4 years ago
parent
commit
9470f0f18f

+ 4 - 1
components/My_navBar/index.js

@@ -3,6 +3,9 @@ Component({
     /**
      * 组件的属性列表
      */
+    options: {
+        addGlobalClass: true
+    },
     properties: {
 
     },
@@ -12,7 +15,7 @@ Component({
             //获取当前登录用户名
             let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
             let userName = '';
-            (data.fagentname != null) ? userName = data.fagentname + '-': userName = data.fname + '-'
+            (data.fagentname != null && data.fagentname != undefined) ? userName = data.fagentname + '-': userName = data.fname + '-'
             userName += data.frole;
             console.log(userName)
             this.setData({

+ 1 - 1
components/My_navBar/index.wxml

@@ -2,7 +2,7 @@
     <view class="header_nav_title" style="height: {{capsule.height}}px;top:{{capsule.top}}px">
         布万家
         <view class="header_user_choice" bindtap="a1212">
-            {{userName}}
+            <view class=" u-line-1">{{userName}}</view>
             <van-icon name="arrow-down" />
         </view>
     </view>

+ 5 - 0
components/My_navBar/index.wxss

@@ -18,7 +18,12 @@
 }
 /* 左侧账号选择 */
 .header_user_choice{
+    display: flex;
     position: absolute;
     font-size: 26rpx;
     left: 30rpx;
 }
+
+.header_user_choice>view{
+    max-width: 230rpx;
+}