Przeglądaj źródła

始宁农业管理后台:农户管理-农户管理

panyong 1 rok temu
rodzic
commit
452d06c773

+ 3 - 1
htmldev/shiningWxMini/pages/businessHome/businessHome.js

@@ -20,6 +20,7 @@ Page({
     ],
     shopInfo: {},
     products: [],
+    shopDetail: {},
     isFetchLock: false, // 接口调用加锁
     isRefresh: false, // 是否下拉刷新
     finished: false
@@ -104,7 +105,8 @@ Page({
       if (status) {
         this.setData({
           shopInfo: data,
-          products: data.products
+          products: Array.isArray(data.products) ? data.products : [],
+          shopDetail: Object.prototype.toString.call(data.shop_info) === '[object Object]' ? data.shop_info : {}
         })
       } else {
         wx.showToast({

+ 3 - 0
htmldev/shiningWxMini/pages/businessHome/businessHome.scss

@@ -47,12 +47,15 @@
 }
 
 .user-name-wrap {
+  width: calc(100% - 224rpx);
   margin-left: 12rpx;
 
   .name {
     line-height: 48rpx;
     font-size: 32rpx;
     color: rgba(37, 31, 57, 1);
+    word-break: break-all;
+    word-wrap: break-word;
   }
 
   .account {

+ 3 - 3
htmldev/shiningWxMini/pages/businessHome/businessHome.wxml

@@ -2,11 +2,11 @@
   <view class="width-690">
     <view class="user-info">
       <view class="portrait">
-        <image src="{{shopInfo.user_head_img_url}}"></image>
+        <image src="{{shopDetail.shop_img_url || shopInfo.user_head_img_url}}"></image>
       </view>
       <view class="user-name-wrap">
-        <view class="name">{{shopInfo.user_nickname}}</view>
-        <view class="account">账号:{{shopInfo.user_phone}}</view>
+        <view class="name">{{ shopDetail.shop_name || shopInfo.user_nickname}}</view>
+        <view class="account">店铺ID:{{shopDetail.id}}</view>
       </view>
       <view
         class="btn-edit-wrap"