Kaynağa Gözat

feat: 更新

贺智杰 4 gün önce
ebeveyn
işleme
7e3c99f28b

+ 4 - 4
pages/home/home.vue

@@ -116,18 +116,18 @@
 			<uni-grid :column="4" :showBorder="false" :highlight="true">
 				<uni-grid-item>
 					<view class="grid-item-box" @click="goScan">
-						<view class="img-box">
+	
 							<image src="@/traceCodePackages/static/images/scan.png" class="img" mode=""></image>
-						</view>
+
 						<text class="text">溯源扫码</text>
 					</view>
 				</uni-grid-item>
 
 				<uni-grid-item>
 					<view class="grid-item-box" @click="goReport">
-						<view class="img-box">
+
 							<image src="@/traceCodePackages/static/images/report.png" class="img" mode=""></image>
-						</view>
+
 						<text class="text">溯源报表</text>
 					</view>
 				</uni-grid-item>

BIN
traceCodePackages/static/images/report.png


BIN
traceCodePackages/static/images/scan.png


+ 3 - 1
traceCodePackages/traceabilityCodeQuery/pages/index.vue

@@ -41,7 +41,9 @@
         </view>
       </view>
     </scroll-view>
-    <Empty text="暂无扫码历史" v-else-if="!loading" />
+    <view v-else-if="!loading" style="margin-top: 20rpx;">
+      <Empty text="暂无扫码历史" />
+    </view>
     <view class="loading-view" v-else="loading">
       <image class="loading-icon" src="../../static/images/loading.png" mode="scaleToFill"
         :style="{ width: '66rpx', height: '50rpx' }" />

+ 11 - 11
traceCodePackages/traceabilityReport/pages/customerScanningRate/wigets/ScanRateTable.vue

@@ -125,17 +125,17 @@
             </template>
           </view>
         </view>
-      </scroll-view>
-      <view v-if="loading" class="table-body" :style="{ height: 'auto' }">
-        <view class="row loading-row">
-          <view class="loading-wrapper">
-            <image class="loading-icon" :src="loadingImg" />
+        <view v-if="loading" class="table-body" :style="{ height: 'auto' }">
+          <view class="row loading-row">
+            <view class="loading-wrapper">
+              <image class="loading-icon" :src="loadingImg" />
+            </view>
           </view>
         </view>
-      </view>
-      <view v-if="!loading && (!list || list.length === 0)">
-        <EmptyView />
-      </view>
+        <view v-if="!loading && (!list || list.length === 0)">
+          <EmptyView />
+        </view>
+      </scroll-view>
     </view>
   </view>
 </template>
@@ -676,7 +676,7 @@ export default {
 
 .section-title {
   position: relative;
-  font-size: 38rpx;
+  font-size: 30rpx;
   font-weight: bold;
   color: #2c69ff;
 }
@@ -686,7 +686,7 @@ export default {
   position: absolute;
   left: -20rpx;
   bottom: 13rpx;
-  width: 4rpx;
+  width: 8rpx;
   height: 50%;
   background: #2c69ff;
 }

+ 11 - 7
traceCodePackages/utils/utils.js

@@ -19,8 +19,8 @@ export function formatDate(
     } else if (data.timestamp) {
       date = data.timestamp * 1000
     } else if (Object.keys(data).length === 0) {
-        // empty object
-        return ""
+      // empty object
+      return ""
     }
     // If object but no date/timestamp property found, and not a Date object, 
     // it might be intended as 'date' if it was structured differently, 
@@ -29,14 +29,14 @@ export function formatDate(
     // extracted above. 
     // But wait, if data is { other: 1 }, date becomes { other: 1 }. new Date({other:1}) is Invalid Date usually.
   }
-  
+
   if (!date) {
-      return ""
+    return ""
   }
 
   const d = new Date(date);
   if (isNaN(d.getTime())) {
-      return ""
+    return ""
   }
 
   const year = d.getFullYear();
@@ -70,8 +70,12 @@ export function hasFunction(key) {
         method: 'GET',
       }
     ).then((res) => {
-      const permissions = res.data?.permissions || []
-      resolve(permissions.includes(key))
+      if (res?.data?.permissions) {
+        const permissions = res.data.permissions || []
+        resolve(permissions.includes(key))
+      } else {
+        reject(res)
+      }
     }).catch(err => {
       reject(err)
     })