Ver código fonte

Merge branch 'master' into dev

wenjie 2 dias atrás
pai
commit
326be12fe1
2 arquivos alterados com 23 adições e 3 exclusões
  1. 21 1
      pages/user/user.js
  2. 2 2
      pages/user/user.wxml

+ 21 - 1
pages/user/user.js

@@ -17,7 +17,8 @@ Page({
     shopAuditStatus: null, //店铺审核状态:0 未审核 1已通过 -1未通过 null 未开店
     shopStatus: null, // 店铺运营状态: -1:未开通 0: 停业中 1:营业中 2:平台下线 3:平台下线待审核
     isSetPassword: false, //是否已经设置过支付密码
-    loginResult: {}
+    loginResult: {},
+    shopName:'',
   },
 
   /**
@@ -45,6 +46,7 @@ Page({
     })
     // 查看是否授权,然后加载订单数据
     util.checkAuthInfo(this._loadOrderCount, true)
+    util.checkAuthInfo(this.getUserInfo, true)
     this.getUserLevelInfo()
     this.getDistInfo()
   },
@@ -285,6 +287,24 @@ Page({
       url: '/pages/binding-phone/binding-phone',
     })
   },
+   /**
+   * 获取用户信息
+   */
+  getUserInfo: function() {
+    var that = this;
+
+    var param = {
+      url: '/p/user/userInfo',
+      method: 'GET',
+      data: {},
+      callBack: (res) => {
+        that.setData({
+          shopName: res.enterprise || ''
+        })
+      }
+    }
+    http.request(param)
+  },
 
   toOrderListPage: function(e) {
     console.log(this.data.isAuthInfo);

+ 2 - 2
pages/user/user.wxml

@@ -10,8 +10,8 @@
         <text class="nick-name">{{loginResult.nickName}}</text>
         <!-- <button class="update-info-btn" open-type="getUserInfo" bindgetuserinfo="toPersonalInfo">更新用户信息</button> -->
       </view>
-      <view class="canpany">
-        铜仁移动
+      <view class="canpany" wx:if="shopName">
+        {{shopName}}
       </view>
       <!-- <view class="level">
         <image class="l-bg" src="{{userLevelInfo.levelType==1?'../../images/icon/integral-icon.png':'../../images/icon/normal-icon.png'}}" role="img"></image>