Explorar el Código

fix: document no data

wangyuan hace 2 años
padre
commit
70c7d8d03a
Se han modificado 2 ficheros con 39 adiciones y 24 borrados
  1. 31 24
      pages/myFile/myFile.wxml
  2. 8 0
      pages/myFile/myFile.wxss

+ 31 - 24
pages/myFile/myFile.wxml

@@ -1,34 +1,41 @@
 <!--pages/allFile/allFile.wxml-->
 <view class="myfile-content">
-  <view class="main-content">
-    <view class="file-item ittflex-jcb" wx:for="{{fileList}}" wx:key="index">
-      <view class="f-left ittflex-jcs">
-        <view class="f-avatar">
-          <image class="head-img" src="{{item.headImg}}"></image>
-        </view>
-        <view class="f-user">
-          <view class="fu-top ittflex-jcs">
-            <text class="fu-name">{{item.realName}}</text>
-            <view class="suer-sex ittflex">
-              <image class="img" src="{{item.sex ? '../../imaes/nan@2x.png' : '../../imaes/nv@2x.png'}}"></image>
+  <block wx:if="{{fileList.length == 0}}">
+    <view class="nodate" >
+      <van-empty description="暂无数据" />
+    </view>
+  </block>
+    <view class="main-content">
+      <block wx:if="{{fileList.length !== 0}}">
+        <view class="file-item ittflex-jcb" wx:for="{{fileList}}" wx:key="index">
+          <view class="f-left ittflex-jcs">
+            <view class="f-avatar">
+              <image class="head-img" src="{{item.headImg}}"></image>
+            </view>
+            <view class="f-user">
+              <view class="fu-top ittflex-jcs">
+                <text class="fu-name">{{item.realName}}</text>
+                <view class="suer-sex ittflex">
+                  <image class="img" src="{{item.sex ? '../../imaes/nan@2x.png' : '../../imaes/nv@2x.png'}}"></image>
+                </view>
+              </view>
+              <view class="fu-bottom fu-date">{{item.birthDay}}</view>
+            </view>
+            <view class="f-qrcode ittflex" data-id="{{item.documentId}}" bindtap="handleShowQRCode">
+              <image class="qrcode-item" src="../../imaes/erweima@2x.png"></image>
             </view>
           </view>
-          <view class="fu-bottom fu-date">{{item.birthDay}}</view>
-        </view>
-        <view class="f-qrcode ittflex" data-id="{{item.documentId}}" bindtap="handleShowQRCode">
-          <image class="qrcode-item" src="../../imaes/erweima@2x.png"></image>
+          <view class="f-right ittflex">
+            <!-- <text class="report-text">已有2份报告</text> -->
+            <text class="report-text report-text-fail">还未产生报告</text>
+          </view>
         </view>
-      </view>
-      <view class="f-right ittflex">
-        <!-- <text class="report-text">已有2份报告</text> -->
-        <text class="report-text report-text-fail">还未产生报告</text>
+      </block>
+      <view class="actions ittflex-jcb">
+        <view class="handle-btn manage-btn ittflex" bindtap="handleFile">管理</view>
+        <view class="handle-btn itt-btn" bindtap="handleAddFile">新建档案</view>
       </view>
     </view>
-    <view class="actions ittflex-jcb">
-      <view class="handle-btn manage-btn ittflex" bindtap="handleFile">管理</view>
-      <view class="handle-btn itt-btn" bindtap="handleAddFile">新建档案</view>
-    </view>
-  </view>
   <view class="my-dialog" wx:if="{{qrcodeDialog}}" bindtap="handleCloseQRCode">
     <view class="qr-content">
       <image class="qr-content" src="{{QRCodeBase64}}"></image>

+ 8 - 0
pages/myFile/myFile.wxss

@@ -11,6 +11,14 @@
   margin: 0 auto;
   padding-bottom: 180rpx;
 }
+.nodate {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-start;
+  align-items: center;
+}
+
 .file-item {
   width: 100%;
   height: 160rpx;